From 3588bc33dbcda4829aafe79ce40f6d0ac80c18ff Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 19 Sep 2018 09:29:50 -0700 Subject: [PATCH 1/2] [AutoPR storSimple1200Series/resource-manager] Fixed GetOperations route to not have subId (#3634) * Generated from e0a88efdeeeef3e945cbc42cbbc00b88dcfcbcf6 Fixed Operations route to not have subId * Generated from df63ef5c9bbbcfd78f98453bd021bc2d4cfdecc0 Remving subid from the path due to prev commit --- .../LICENSE.txt | 42 +++++----- .../storSimple1200SeriesManagement/README.md | 80 +++++++++---------- .../availableProviderOperationsOperations.js | 6 +- 3 files changed, 62 insertions(+), 66 deletions(-) diff --git a/lib/services/storSimple1200SeriesManagement/LICENSE.txt b/lib/services/storSimple1200SeriesManagement/LICENSE.txt index a70e8cf660..5431ba98b9 100644 --- a/lib/services/storSimple1200SeriesManagement/LICENSE.txt +++ b/lib/services/storSimple1200SeriesManagement/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2018 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. +The MIT License (MIT) + +Copyright (c) 2018 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/storSimple1200SeriesManagement/README.md b/lib/services/storSimple1200SeriesManagement/README.md index 869f5fceeb..291532b8e5 100644 --- a/lib/services/storSimple1200SeriesManagement/README.md +++ b/lib/services/storSimple1200SeriesManagement/README.md @@ -1,40 +1,40 @@ ---- -uid: azure-arm-storsimple1200series -summary: *content - ---- -# Microsoft Azure SDK for Node.js - StorSimpleManagementClient -This project provides a Node.js package for accessing Azure. Right now it supports: -- **Node.js version 6.x.x or higher** - -## Features - - -## How to Install - -```bash -npm install azure-arm-storsimple1200series -``` - -## How to use - -### Authentication, client creation and list managers as an example. - -```javascript -const msRestAzure = require("ms-rest-azure"); -const StorSimpleManagementClient = require("azure-arm-storsimple1200series"); -msRestAzure.interactiveLogin().then((creds) => { - const subscriptionId = ""; - const client = new StorSimpleManagementClient(creds, subscriptionId); - return client.managers.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.log('An error occurred:'); - console.dir(err, {depth: null, colors: true}); -}); - -## Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) +--- +uid: azure-arm-storsimple1200series +summary: *content + +--- +# Microsoft Azure SDK for Node.js - StorSimpleManagementClient +This project provides a Node.js package for accessing Azure. Right now it supports: +- **Node.js version 6.x.x or higher** + +## Features + + +## How to Install + +```bash +npm install azure-arm-storsimple1200series +``` + +## How to use + +### Authentication, client creation and list managers as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const StorSimpleManagementClient = require("azure-arm-storsimple1200series"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new StorSimpleManagementClient(creds, subscriptionId); + return client.managers.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.log('An error occurred:'); + console.dir(err, {depth: null, colors: true}); +}); + +## Related projects + +- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/storSimple1200SeriesManagement/lib/operations/availableProviderOperationsOperations.js b/lib/services/storSimple1200SeriesManagement/lib/operations/availableProviderOperationsOperations.js index 9cd31796dd..3b5c08ac5d 100644 --- a/lib/services/storSimple1200SeriesManagement/lib/operations/availableProviderOperationsOperations.js +++ b/lib/services/storSimple1200SeriesManagement/lib/operations/availableProviderOperationsOperations.js @@ -48,9 +48,6 @@ function _list(options, callback) { } // Validate try { - 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.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.'); } @@ -63,8 +60,7 @@ function _list(options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.StorSimple/operations'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.StorSimple/operations'; let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { From 6fc23420e1799af7fd87bcb832618fb03dc04045 Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Wed, 19 Sep 2018 12:30:53 -0700 Subject: [PATCH 2/2] Update azure-arm-storsimple1200series to 1.0.1 and remove extra folder --- lib/services/storSimple1200Series/LICENSE.txt | 21 - lib/services/storSimple1200Series/README.md | 40 - .../lib/models/accessControlRecord.js | 80 - .../lib/models/accessControlRecordList.js | 59 - .../storSimple1200Series/lib/models/alert.js | 208 - .../lib/models/alertErrorDetails.js | 68 - .../lib/models/alertFilter.js | 90 - .../lib/models/alertList.js | 67 - .../lib/models/alertSettings.js | 121 - .../lib/models/alertSource.js | 70 - .../lib/models/asymmetricEncryptedSecret.js | 77 - .../lib/models/availableProviderOperation.js | 110 - .../availableProviderOperationDisplay.js | 99 - .../lib/models/availableProviderOperations.js | 68 - .../storSimple1200Series/lib/models/backup.js | 147 - .../lib/models/backupElement.js | 98 - .../lib/models/backupFilter.js | 62 - .../lib/models/backupList.js | 67 - .../lib/models/backupScheduleGroup.js | 84 - .../lib/models/backupScheduleGroupList.js | 59 - .../lib/models/baseModel.js | 71 - .../lib/models/chapSettings.js | 88 - .../lib/models/chapSettingsList.js | 59 - .../lib/models/clearAlertRequest.js | 68 - .../lib/models/cloneRequest.js | 117 - .../storSimple1200Series/lib/models/device.js | 237 - .../lib/models/deviceDetails.js | 135 - .../lib/models/deviceList.js | 59 - .../lib/models/devicePatch.js | 54 - .../lib/models/encryptionSettings.js | 95 - .../lib/models/errorModel.js | 78 - .../lib/models/failoverRequest.js | 83 - .../lib/models/fileServer.js | 104 - .../lib/models/fileServerList.js | 59 - .../lib/models/fileShare.js | 148 - .../lib/models/fileShareList.js | 59 - .../lib/models/iPConfig.js | 69 - .../lib/models/iSCSIDisk.js | 153 - .../lib/models/iSCSIDiskList.js | 59 - .../lib/models/iSCSIServer.js | 112 - .../lib/models/iSCSIServerList.js | 59 - .../lib/models/index.d.ts | 1766 --- .../storSimple1200Series/lib/models/index.js | 102 - .../storSimple1200Series/lib/models/item.js | 59 - .../storSimple1200Series/lib/models/job.js | 267 - .../lib/models/jobErrorDetails.js | 77 - .../lib/models/jobErrorItem.js | 76 - .../lib/models/jobFilter.js | 73 - .../lib/models/jobList.js | 67 - .../lib/models/jobStage.js | 79 - .../lib/models/jobStats.js | 68 - .../lib/models/manager.js | 134 - .../lib/models/managerExtendedInfo.js | 134 - .../lib/models/managerIntrinsicSettings.js | 54 - .../lib/models/managerList.js | 59 - .../lib/models/managerPatch.js | 59 - .../lib/models/managerSku.js | 53 - .../lib/models/message.js | 59 - .../lib/models/metricAvailablity.js | 63 - .../lib/models/metricData.js | 94 - .../lib/models/metricDefinition.js | 124 - .../lib/models/metricDefinitionList.js | 59 - .../lib/models/metricDimension.js | 60 - .../lib/models/metricFilter.js | 78 - .../lib/models/metricList.js | 59 - .../lib/models/metricName.js | 60 - .../lib/models/metricNameFilter.js | 52 - .../lib/models/metrics.js | 150 - .../lib/models/networkAdapter.js | 98 - .../lib/models/networkSettings.js | 106 - .../lib/models/nodeNetwork.js | 60 - .../lib/models/resource.js | 98 - .../lib/models/securitySettings.js | 93 - .../lib/models/sendTestAlertEmailRequest.js | 59 - .../lib/models/storageAccountCredential.js | 132 - .../models/storageAccountCredentialList.js | 59 - .../lib/models/storageDomain.js | 116 - .../lib/models/storageDomainList.js | 59 - .../lib/models/symmetricEncryptedSecret.js | 76 - .../storSimple1200Series/lib/models/time.js | 68 - .../lib/models/timeSettings.js | 99 - .../lib/models/updateDownloadProgress.js | 95 - .../lib/models/updateInstallProgress.js | 68 - .../lib/models/updates.js | 208 - .../lib/models/uploadCertificateRequest.js | 78 - .../lib/models/uploadCertificateResponse.js | 188 - .../lib/operations/accessControlRecords.js | 1408 --- .../lib/operations/alerts.js | 1023 -- .../availableProviderOperationsOperations.js | 459 - .../lib/operations/backupScheduleGroups.js | 1463 --- .../lib/operations/backups.js | 2142 ---- .../lib/operations/chapSettingsOperations.js | 1497 --- .../lib/operations/devices.js | 6317 ----------- .../lib/operations/fileServers.js | 2654 ----- .../lib/operations/fileShares.js | 2391 ---- .../lib/operations/index.d.ts | 9719 ----------------- .../lib/operations/index.js | 31 - .../lib/operations/iscsiDisks.js | 2379 ---- .../lib/operations/iscsiServers.js | 2666 ----- .../lib/operations/jobs.js | 1240 --- .../lib/operations/managers.js | 3965 ------- .../operations/storageAccountCredentials.js | 1540 --- .../lib/operations/storageDomains.js | 1493 --- .../lib/storSimpleManagementClient.d.ts | 76 - .../lib/storSimpleManagementClient.js | 99 - .../storSimple1200Series/package.json | 25 - .../package.json | 2 +- 107 files changed, 1 insertion(+), 51994 deletions(-) delete mode 100644 lib/services/storSimple1200Series/LICENSE.txt delete mode 100644 lib/services/storSimple1200Series/README.md delete mode 100644 lib/services/storSimple1200Series/lib/models/accessControlRecord.js delete mode 100644 lib/services/storSimple1200Series/lib/models/accessControlRecordList.js delete mode 100644 lib/services/storSimple1200Series/lib/models/alert.js delete mode 100644 lib/services/storSimple1200Series/lib/models/alertErrorDetails.js delete mode 100644 lib/services/storSimple1200Series/lib/models/alertFilter.js delete mode 100644 lib/services/storSimple1200Series/lib/models/alertList.js delete mode 100644 lib/services/storSimple1200Series/lib/models/alertSettings.js delete mode 100644 lib/services/storSimple1200Series/lib/models/alertSource.js delete mode 100644 lib/services/storSimple1200Series/lib/models/asymmetricEncryptedSecret.js delete mode 100644 lib/services/storSimple1200Series/lib/models/availableProviderOperation.js delete mode 100644 lib/services/storSimple1200Series/lib/models/availableProviderOperationDisplay.js delete mode 100644 lib/services/storSimple1200Series/lib/models/availableProviderOperations.js delete mode 100644 lib/services/storSimple1200Series/lib/models/backup.js delete mode 100644 lib/services/storSimple1200Series/lib/models/backupElement.js delete mode 100644 lib/services/storSimple1200Series/lib/models/backupFilter.js delete mode 100644 lib/services/storSimple1200Series/lib/models/backupList.js delete mode 100644 lib/services/storSimple1200Series/lib/models/backupScheduleGroup.js delete mode 100644 lib/services/storSimple1200Series/lib/models/backupScheduleGroupList.js delete mode 100644 lib/services/storSimple1200Series/lib/models/baseModel.js delete mode 100644 lib/services/storSimple1200Series/lib/models/chapSettings.js delete mode 100644 lib/services/storSimple1200Series/lib/models/chapSettingsList.js delete mode 100644 lib/services/storSimple1200Series/lib/models/clearAlertRequest.js delete mode 100644 lib/services/storSimple1200Series/lib/models/cloneRequest.js delete mode 100644 lib/services/storSimple1200Series/lib/models/device.js delete mode 100644 lib/services/storSimple1200Series/lib/models/deviceDetails.js delete mode 100644 lib/services/storSimple1200Series/lib/models/deviceList.js delete mode 100644 lib/services/storSimple1200Series/lib/models/devicePatch.js delete mode 100644 lib/services/storSimple1200Series/lib/models/encryptionSettings.js delete mode 100644 lib/services/storSimple1200Series/lib/models/errorModel.js delete mode 100644 lib/services/storSimple1200Series/lib/models/failoverRequest.js delete mode 100644 lib/services/storSimple1200Series/lib/models/fileServer.js delete mode 100644 lib/services/storSimple1200Series/lib/models/fileServerList.js delete mode 100644 lib/services/storSimple1200Series/lib/models/fileShare.js delete mode 100644 lib/services/storSimple1200Series/lib/models/fileShareList.js delete mode 100644 lib/services/storSimple1200Series/lib/models/iPConfig.js delete mode 100644 lib/services/storSimple1200Series/lib/models/iSCSIDisk.js delete mode 100644 lib/services/storSimple1200Series/lib/models/iSCSIDiskList.js delete mode 100644 lib/services/storSimple1200Series/lib/models/iSCSIServer.js delete mode 100644 lib/services/storSimple1200Series/lib/models/iSCSIServerList.js delete mode 100644 lib/services/storSimple1200Series/lib/models/index.d.ts delete mode 100644 lib/services/storSimple1200Series/lib/models/index.js delete mode 100644 lib/services/storSimple1200Series/lib/models/item.js delete mode 100644 lib/services/storSimple1200Series/lib/models/job.js delete mode 100644 lib/services/storSimple1200Series/lib/models/jobErrorDetails.js delete mode 100644 lib/services/storSimple1200Series/lib/models/jobErrorItem.js delete mode 100644 lib/services/storSimple1200Series/lib/models/jobFilter.js delete mode 100644 lib/services/storSimple1200Series/lib/models/jobList.js delete mode 100644 lib/services/storSimple1200Series/lib/models/jobStage.js delete mode 100644 lib/services/storSimple1200Series/lib/models/jobStats.js delete mode 100644 lib/services/storSimple1200Series/lib/models/manager.js delete mode 100644 lib/services/storSimple1200Series/lib/models/managerExtendedInfo.js delete mode 100644 lib/services/storSimple1200Series/lib/models/managerIntrinsicSettings.js delete mode 100644 lib/services/storSimple1200Series/lib/models/managerList.js delete mode 100644 lib/services/storSimple1200Series/lib/models/managerPatch.js delete mode 100644 lib/services/storSimple1200Series/lib/models/managerSku.js delete mode 100644 lib/services/storSimple1200Series/lib/models/message.js delete mode 100644 lib/services/storSimple1200Series/lib/models/metricAvailablity.js delete mode 100644 lib/services/storSimple1200Series/lib/models/metricData.js delete mode 100644 lib/services/storSimple1200Series/lib/models/metricDefinition.js delete mode 100644 lib/services/storSimple1200Series/lib/models/metricDefinitionList.js delete mode 100644 lib/services/storSimple1200Series/lib/models/metricDimension.js delete mode 100644 lib/services/storSimple1200Series/lib/models/metricFilter.js delete mode 100644 lib/services/storSimple1200Series/lib/models/metricList.js delete mode 100644 lib/services/storSimple1200Series/lib/models/metricName.js delete mode 100644 lib/services/storSimple1200Series/lib/models/metricNameFilter.js delete mode 100644 lib/services/storSimple1200Series/lib/models/metrics.js delete mode 100644 lib/services/storSimple1200Series/lib/models/networkAdapter.js delete mode 100644 lib/services/storSimple1200Series/lib/models/networkSettings.js delete mode 100644 lib/services/storSimple1200Series/lib/models/nodeNetwork.js delete mode 100644 lib/services/storSimple1200Series/lib/models/resource.js delete mode 100644 lib/services/storSimple1200Series/lib/models/securitySettings.js delete mode 100644 lib/services/storSimple1200Series/lib/models/sendTestAlertEmailRequest.js delete mode 100644 lib/services/storSimple1200Series/lib/models/storageAccountCredential.js delete mode 100644 lib/services/storSimple1200Series/lib/models/storageAccountCredentialList.js delete mode 100644 lib/services/storSimple1200Series/lib/models/storageDomain.js delete mode 100644 lib/services/storSimple1200Series/lib/models/storageDomainList.js delete mode 100644 lib/services/storSimple1200Series/lib/models/symmetricEncryptedSecret.js delete mode 100644 lib/services/storSimple1200Series/lib/models/time.js delete mode 100644 lib/services/storSimple1200Series/lib/models/timeSettings.js delete mode 100644 lib/services/storSimple1200Series/lib/models/updateDownloadProgress.js delete mode 100644 lib/services/storSimple1200Series/lib/models/updateInstallProgress.js delete mode 100644 lib/services/storSimple1200Series/lib/models/updates.js delete mode 100644 lib/services/storSimple1200Series/lib/models/uploadCertificateRequest.js delete mode 100644 lib/services/storSimple1200Series/lib/models/uploadCertificateResponse.js delete mode 100644 lib/services/storSimple1200Series/lib/operations/accessControlRecords.js delete mode 100644 lib/services/storSimple1200Series/lib/operations/alerts.js delete mode 100644 lib/services/storSimple1200Series/lib/operations/availableProviderOperationsOperations.js delete mode 100644 lib/services/storSimple1200Series/lib/operations/backupScheduleGroups.js delete mode 100644 lib/services/storSimple1200Series/lib/operations/backups.js delete mode 100644 lib/services/storSimple1200Series/lib/operations/chapSettingsOperations.js delete mode 100644 lib/services/storSimple1200Series/lib/operations/devices.js delete mode 100644 lib/services/storSimple1200Series/lib/operations/fileServers.js delete mode 100644 lib/services/storSimple1200Series/lib/operations/fileShares.js delete mode 100644 lib/services/storSimple1200Series/lib/operations/index.d.ts delete mode 100644 lib/services/storSimple1200Series/lib/operations/index.js delete mode 100644 lib/services/storSimple1200Series/lib/operations/iscsiDisks.js delete mode 100644 lib/services/storSimple1200Series/lib/operations/iscsiServers.js delete mode 100644 lib/services/storSimple1200Series/lib/operations/jobs.js delete mode 100644 lib/services/storSimple1200Series/lib/operations/managers.js delete mode 100644 lib/services/storSimple1200Series/lib/operations/storageAccountCredentials.js delete mode 100644 lib/services/storSimple1200Series/lib/operations/storageDomains.js delete mode 100644 lib/services/storSimple1200Series/lib/storSimpleManagementClient.d.ts delete mode 100644 lib/services/storSimple1200Series/lib/storSimpleManagementClient.js delete mode 100644 lib/services/storSimple1200Series/package.json diff --git a/lib/services/storSimple1200Series/LICENSE.txt b/lib/services/storSimple1200Series/LICENSE.txt deleted file mode 100644 index 5431ba98b9..0000000000 --- a/lib/services/storSimple1200Series/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2018 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/storSimple1200Series/README.md b/lib/services/storSimple1200Series/README.md deleted file mode 100644 index fec67a3a0d..0000000000 --- a/lib/services/storSimple1200Series/README.md +++ /dev/null @@ -1,40 +0,0 @@ ---- -uid: azure-arm-storSimple1200Series -summary: *content - ---- -# Microsoft Azure SDK for Node.js - StorSimpleManagementClient -This project provides a Node.js package for accessing Azure. Right now it supports: -- **Node.js version 6.x.x or higher** - -## Features - - -## How to Install - -```bash -npm install azure-arm-storSimple1200Series -``` - -## How to use - -### Authentication, client creation and list managers as an example. - -```javascript -const msRestAzure = require("ms-rest-azure"); -const StorSimpleManagementClient = require("azure-arm-storSimple1200Series"); -msRestAzure.interactiveLogin().then((creds) => { - const subscriptionId = ""; - const client = new StorSimpleManagementClient(creds, subscriptionId); - return client.managers.list().then((result) => { - console.log("The result is:"); - console.log(result); - }); -}).catch((err) => { - console.log('An error occurred:'); - console.dir(err, {depth: null, colors: true}); -}); - -## Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/storSimple1200Series/lib/models/accessControlRecord.js b/lib/services/storSimple1200Series/lib/models/accessControlRecord.js deleted file mode 100644 index fc80b529e1..0000000000 --- a/lib/services/storSimple1200Series/lib/models/accessControlRecord.js +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The access control record - * - * @extends models['BaseModel'] - */ -class AccessControlRecord extends models['BaseModel'] { - /** - * Create a AccessControlRecord. - * @member {string} initiatorName The Iscsi initiator name (IQN) - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AccessControlRecord - * - * @returns {object} metadata of AccessControlRecord - * - */ - mapper() { - return { - required: false, - serializedName: 'AccessControlRecord', - type: { - name: 'Composite', - className: 'AccessControlRecord', - 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' - } - }, - initiatorName: { - required: true, - serializedName: 'properties.initiatorName', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AccessControlRecord; diff --git a/lib/services/storSimple1200Series/lib/models/accessControlRecordList.js b/lib/services/storSimple1200Series/lib/models/accessControlRecordList.js deleted file mode 100644 index 63ff67486f..0000000000 --- a/lib/services/storSimple1200Series/lib/models/accessControlRecordList.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Collection of AccessControlRecords - */ -class AccessControlRecordList extends Array { - /** - * Create a AccessControlRecordList. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AccessControlRecordList - * - * @returns {object} metadata of AccessControlRecordList - * - */ - mapper() { - return { - required: false, - serializedName: 'AccessControlRecordList', - type: { - name: 'Composite', - className: 'AccessControlRecordList', - modelProperties: { - value: { - required: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AccessControlRecordElementType', - type: { - name: 'Composite', - className: 'AccessControlRecord' - } - } - } - } - } - } - }; - } -} - -module.exports = AccessControlRecordList; diff --git a/lib/services/storSimple1200Series/lib/models/alert.js b/lib/services/storSimple1200Series/lib/models/alert.js deleted file mode 100644 index e6bf992e2e..0000000000 --- a/lib/services/storSimple1200Series/lib/models/alert.js +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Alert class - * - * @extends models['BaseModel'] - */ -class Alert extends models['BaseModel'] { - /** - * Create a Alert. - * @member {string} title Title of the alert - * @member {string} scope Device or Resource alert. Possible values include: - * 'Resource', 'Device' - * @member {string} alertType Type of the alert - * @member {date} appearedAtTime UTC time at which the alert appeared - * @member {date} appearedAtSourceTime UTC time at which the alert appeared - * on the source - * @member {date} [clearedAtTime] UTC time at which the alert got cleared - * @member {date} [clearedAtSourceTime] UTC time at which the alert was - * cleared on the source - * @member {object} source Source at which the alert was cleared - * @member {string} [source.name] Name of the source. - * @member {string} [source.timeZone] The time zone. - * @member {string} [source.alertSourceType] Source type of the alert. - * Possible values include: 'Resource', 'Device' - * @member {string} [recommendation] Recommendation for acting on the alert - * @member {string} [resolutionReason] Reason for resolving the alert - * @member {string} severity Severity of the alert. Possible values include: - * 'Informational', 'Warning', 'Critical' - * @member {string} status Current status of the alert. Possible values - * include: 'Active', 'Cleared' - * @member {object} [errorDetails] ErrorDetails of the alert - * @member {string} [errorDetails.errorCode] Error code. - * @member {string} [errorDetails.errorMessage] Error Message - * @member {number} [errorDetails.occurences] Number of occurences. - * @member {object} [detailedInformation] Other information about the alert - */ - constructor() { - super(); - } - - /** - * Defines the metadata of Alert - * - * @returns {object} metadata of Alert - * - */ - mapper() { - return { - required: false, - serializedName: 'Alert', - type: { - name: 'Composite', - className: 'Alert', - 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' - } - }, - title: { - required: true, - serializedName: 'properties.title', - type: { - name: 'String' - } - }, - scope: { - required: true, - serializedName: 'properties.scope', - type: { - name: 'Enum', - allowedValues: [ 'Resource', 'Device' ] - } - }, - alertType: { - required: true, - serializedName: 'properties.alertType', - type: { - name: 'String' - } - }, - appearedAtTime: { - required: true, - serializedName: 'properties.appearedAtTime', - type: { - name: 'DateTime' - } - }, - appearedAtSourceTime: { - required: true, - serializedName: 'properties.appearedAtSourceTime', - type: { - name: 'DateTime' - } - }, - clearedAtTime: { - required: false, - serializedName: 'properties.clearedAtTime', - type: { - name: 'DateTime' - } - }, - clearedAtSourceTime: { - required: false, - serializedName: 'properties.clearedAtSourceTime', - type: { - name: 'DateTime' - } - }, - source: { - required: true, - serializedName: 'properties.source', - type: { - name: 'Composite', - className: 'AlertSource' - } - }, - recommendation: { - required: false, - serializedName: 'properties.recommendation', - type: { - name: 'String' - } - }, - resolutionReason: { - required: false, - serializedName: 'properties.resolutionReason', - type: { - name: 'String' - } - }, - severity: { - required: true, - serializedName: 'properties.severity', - type: { - name: 'Enum', - allowedValues: [ 'Informational', 'Warning', 'Critical' ] - } - }, - status: { - required: true, - serializedName: 'properties.status', - type: { - name: 'Enum', - allowedValues: [ 'Active', 'Cleared' ] - } - }, - errorDetails: { - required: false, - serializedName: 'properties.errorDetails', - type: { - name: 'Composite', - className: 'AlertErrorDetails' - } - }, - detailedInformation: { - required: false, - serializedName: 'properties.detailedInformation', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = Alert; diff --git a/lib/services/storSimple1200Series/lib/models/alertErrorDetails.js b/lib/services/storSimple1200Series/lib/models/alertErrorDetails.js deleted file mode 100644 index c71fd7be59..0000000000 --- a/lib/services/storSimple1200Series/lib/models/alertErrorDetails.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Errordetails for the alert - * - */ -class AlertErrorDetails { - /** - * Create a AlertErrorDetails. - * @member {string} [errorCode] Error code. - * @member {string} [errorMessage] Error Message - * @member {number} [occurences] Number of occurences. - */ - constructor() { - } - - /** - * Defines the metadata of AlertErrorDetails - * - * @returns {object} metadata of AlertErrorDetails - * - */ - mapper() { - return { - required: false, - serializedName: 'AlertErrorDetails', - type: { - name: 'Composite', - className: 'AlertErrorDetails', - modelProperties: { - errorCode: { - required: false, - serializedName: 'errorCode', - type: { - name: 'String' - } - }, - errorMessage: { - required: false, - serializedName: 'errorMessage', - type: { - name: 'String' - } - }, - occurences: { - required: false, - serializedName: 'occurences', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = AlertErrorDetails; diff --git a/lib/services/storSimple1200Series/lib/models/alertFilter.js b/lib/services/storSimple1200Series/lib/models/alertFilter.js deleted file mode 100644 index 57ac32943f..0000000000 --- a/lib/services/storSimple1200Series/lib/models/alertFilter.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Filters that can be specified on the alert - * - */ -class AlertFilter { - /** - * Create a AlertFilter. - * @member {string} [status] Status of the alert. Possible values include: - * 'Active', 'Cleared' - * @member {string} [severity] Severity of the alert. Possible values - * include: 'Informational', 'Warning', 'Critical' - * @member {string} [sourceType] Source of the alert. Possible values - * include: 'Resource', 'Device' - * @member {string} [sourceName] Source name of the alert - * @member {date} [appearedOnTime] UTC time on which the alert appeared - */ - constructor() { - } - - /** - * Defines the metadata of AlertFilter - * - * @returns {object} metadata of AlertFilter - * - */ - mapper() { - return { - required: false, - serializedName: 'AlertFilter', - type: { - name: 'Composite', - className: 'AlertFilter', - modelProperties: { - status: { - required: false, - serializedName: 'status', - type: { - name: 'Enum', - allowedValues: [ 'Active', 'Cleared' ] - } - }, - severity: { - required: false, - serializedName: 'severity', - type: { - name: 'Enum', - allowedValues: [ 'Informational', 'Warning', 'Critical' ] - } - }, - sourceType: { - required: false, - serializedName: 'sourceType', - type: { - name: 'Enum', - allowedValues: [ 'Resource', 'Device' ] - } - }, - sourceName: { - required: false, - serializedName: 'sourceName', - type: { - name: 'String' - } - }, - appearedOnTime: { - required: false, - serializedName: 'appearedOnTime', - type: { - name: 'DateTime' - } - } - } - } - }; - } -} - -module.exports = AlertFilter; diff --git a/lib/services/storSimple1200Series/lib/models/alertList.js b/lib/services/storSimple1200Series/lib/models/alertList.js deleted file mode 100644 index 189c458e61..0000000000 --- a/lib/services/storSimple1200Series/lib/models/alertList.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Collection of Alerts - */ -class AlertList extends Array { - /** - * Create a AlertList. - * @member {string} [nextLink] Id of the next page of alerts - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AlertList - * - * @returns {object} metadata of AlertList - * - */ - mapper() { - return { - required: false, - serializedName: 'AlertList', - type: { - name: 'Composite', - className: 'AlertList', - modelProperties: { - value: { - required: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AlertElementType', - type: { - name: 'Composite', - className: 'Alert' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AlertList; diff --git a/lib/services/storSimple1200Series/lib/models/alertSettings.js b/lib/services/storSimple1200Series/lib/models/alertSettings.js deleted file mode 100644 index eb317f0ba5..0000000000 --- a/lib/services/storSimple1200Series/lib/models/alertSettings.js +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * AlertSettings on the device which represents how alerts will be processed - * - * @extends models['BaseModel'] - */ -class AlertSettings extends models['BaseModel'] { - /** - * Create a AlertSettings. - * @member {string} emailNotification Value indicating whether user/admins - * will receive emails when an alert condition occurs on the system. Possible - * values include: 'Enabled', 'Disabled' - * @member {string} notificationToServiceOwners Value indicating whether - * service owners will receive emails when an alert condition occurs on the - * system. Applicable only if emailNotification flag is Enabled. Possible - * values include: 'Enabled', 'Disabled' - * @member {string} alertNotificationCulture Culture setting to be used while - * building alert emails. For eg: "en-US" - * @member {array} [additionalRecipientEmailList] List of email addresses - * (apart from admin/coadmin of subscription) to whom the alert emails need - * to be sent - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AlertSettings - * - * @returns {object} metadata of AlertSettings - * - */ - mapper() { - return { - required: false, - serializedName: 'AlertSettings', - type: { - name: 'Composite', - className: 'AlertSettings', - 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' - } - }, - emailNotification: { - required: true, - serializedName: 'properties.emailNotification', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - }, - notificationToServiceOwners: { - required: true, - serializedName: 'properties.notificationToServiceOwners', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - }, - alertNotificationCulture: { - required: true, - serializedName: 'properties.alertNotificationCulture', - type: { - name: 'String' - } - }, - additionalRecipientEmailList: { - required: false, - serializedName: 'properties.additionalRecipientEmailList', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = AlertSettings; diff --git a/lib/services/storSimple1200Series/lib/models/alertSource.js b/lib/services/storSimple1200Series/lib/models/alertSource.js deleted file mode 100644 index 61a03ba4aa..0000000000 --- a/lib/services/storSimple1200Series/lib/models/alertSource.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * source at which the alert can be raised - * - */ -class AlertSource { - /** - * Create a AlertSource. - * @member {string} [name] Name of the source. - * @member {string} [timeZone] The time zone. - * @member {string} [alertSourceType] Source type of the alert. Possible - * values include: 'Resource', 'Device' - */ - constructor() { - } - - /** - * Defines the metadata of AlertSource - * - * @returns {object} metadata of AlertSource - * - */ - mapper() { - return { - required: false, - serializedName: 'AlertSource', - type: { - name: 'Composite', - className: 'AlertSource', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - timeZone: { - required: false, - serializedName: 'timeZone', - type: { - name: 'String' - } - }, - alertSourceType: { - required: false, - serializedName: 'alertSourceType', - type: { - name: 'Enum', - allowedValues: [ 'Resource', 'Device' ] - } - } - } - } - }; - } -} - -module.exports = AlertSource; diff --git a/lib/services/storSimple1200Series/lib/models/asymmetricEncryptedSecret.js b/lib/services/storSimple1200Series/lib/models/asymmetricEncryptedSecret.js deleted file mode 100644 index c1cf383d8e..0000000000 --- a/lib/services/storSimple1200Series/lib/models/asymmetricEncryptedSecret.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * This class can be used as the Type for any secret entity represented as - * Password, CertThumbprint, Algorithm. This class is intended to be used when - * the secret is encrypted with an asymmetric key pair. The encryptionAlgorithm - * field is mainly for future usage to potentially allow different entities - * encrypted using different algorithms. - * - */ -class AsymmetricEncryptedSecret { - /** - * Create a AsymmetricEncryptedSecret. - * @member {string} value The value of the secret itself. If the secret is in - * plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. - * @member {string} [encryptionCertificateThumbprint] Thumbprint certificate - * that was used to encrypt "Value" - * @member {string} encryptionAlgorithm Algorithm used to encrypt "Value". - * Possible values include: 'None', 'AES256', 'RSAES_PKCS1_v_1_5' - */ - constructor() { - } - - /** - * Defines the metadata of AsymmetricEncryptedSecret - * - * @returns {object} metadata of AsymmetricEncryptedSecret - * - */ - mapper() { - return { - required: false, - serializedName: 'AsymmetricEncryptedSecret', - type: { - name: 'Composite', - className: 'AsymmetricEncryptedSecret', - modelProperties: { - value: { - required: true, - serializedName: 'value', - type: { - name: 'String' - } - }, - encryptionCertificateThumbprint: { - required: false, - serializedName: 'encryptionCertificateThumbprint', - type: { - name: 'String' - } - }, - encryptionAlgorithm: { - required: true, - serializedName: 'encryptionAlgorithm', - type: { - name: 'Enum', - allowedValues: [ 'None', 'AES256', 'RSAES_PKCS1_v_1_5' ] - } - } - } - } - }; - } -} - -module.exports = AsymmetricEncryptedSecret; diff --git a/lib/services/storSimple1200Series/lib/models/availableProviderOperation.js b/lib/services/storSimple1200Series/lib/models/availableProviderOperation.js deleted file mode 100644 index e4acf70e95..0000000000 --- a/lib/services/storSimple1200Series/lib/models/availableProviderOperation.js +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Class represents provider operation - * - */ -class AvailableProviderOperation { - /** - * Create a AvailableProviderOperation. - * @member {string} [name] Gets or sets the name of the operation being - * performed on this particular object - * Return value format: - * "{resourceProviderNamespace}/{resourceType}/{read|write|deletion|action}" - * Eg: Microsoft.StorSimple/managers/devices/fileServers/read - * Microsoft.StorSimple/managers/devices/alerts/clearAlerts/action - * @member {object} [display] Gets or sets Display information - * Contains the localized display information for this particular - * operation/action - * @member {string} [display.provider] Gets or sets Provider - * The localized friendly form of the resource provider name – it is expected - * to also include the publisher/company responsible. - * It should use Title Casing and begin with “Microsoft” for 1st party - * services. - * @member {string} [display.resource] Gets or sets Resource - * The localized friendly form of the resource type related to this - * action/operation – it should match the public documentation for the - * resource provider. - * It should use Title Casing – for examples, please refer to the “name” - * section. - * @member {string} [display.operation] Gets or sets Operation - * The localized friendly name for the operation, as it should be shown to - * the user. - * It should be concise (to fit in drop downs) but clear (i.e. - * self-documenting). It should use Title Casing and include the - * entity/resource to which it applies. - * @member {string} [display.description] Gets or sets Description - * The localized friendly description for the operation, as it should be - * shown to the user. - * It should be thorough, yet concise – it will be used in tool tips and - * detailed views. - * @member {string} [origin] Gets or sets Origin - * The intended executor of the operation; governs the display of the - * operation in the RBAC UX and the audit logs UX. - * Default value is “user,system” - * @member {object} [properties] Gets or sets Properties - * Reserved for future use - */ - constructor() { - } - - /** - * Defines the metadata of AvailableProviderOperation - * - * @returns {object} metadata of AvailableProviderOperation - * - */ - mapper() { - return { - required: false, - serializedName: 'AvailableProviderOperation', - type: { - name: 'Composite', - className: 'AvailableProviderOperation', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'String' - } - }, - display: { - required: false, - serializedName: 'display', - type: { - name: 'Composite', - className: 'AvailableProviderOperationDisplay' - } - }, - origin: { - required: false, - serializedName: 'origin', - type: { - name: 'String' - } - }, - properties: { - required: false, - serializedName: 'properties', - type: { - name: 'Object' - } - } - } - } - }; - } -} - -module.exports = AvailableProviderOperation; diff --git a/lib/services/storSimple1200Series/lib/models/availableProviderOperationDisplay.js b/lib/services/storSimple1200Series/lib/models/availableProviderOperationDisplay.js deleted file mode 100644 index bd3c8b376c..0000000000 --- a/lib/services/storSimple1200Series/lib/models/availableProviderOperationDisplay.js +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Contains the localized display information for this particular operation / - * action. - * These value will be used by several clients for - * (1) custom role definitions for RBAC; - * (2) complex query filters for the event service; and (3) audit history / - * records for management operations. - * - */ -class AvailableProviderOperationDisplay { - /** - * Create a AvailableProviderOperationDisplay. - * @member {string} [provider] Gets or sets Provider - * The localized friendly form of the resource provider name – it is expected - * to also include the publisher/company responsible. - * It should use Title Casing and begin with “Microsoft” for 1st party - * services. - * @member {string} [resource] Gets or sets Resource - * The localized friendly form of the resource type related to this - * action/operation – it should match the public documentation for the - * resource provider. - * It should use Title Casing – for examples, please refer to the “name” - * section. - * @member {string} [operation] Gets or sets Operation - * The localized friendly name for the operation, as it should be shown to - * the user. - * It should be concise (to fit in drop downs) but clear (i.e. - * self-documenting). It should use Title Casing and include the - * entity/resource to which it applies. - * @member {string} [description] Gets or sets Description - * The localized friendly description for the operation, as it should be - * shown to the user. - * It should be thorough, yet concise – it will be used in tool tips and - * detailed views. - */ - constructor() { - } - - /** - * Defines the metadata of AvailableProviderOperationDisplay - * - * @returns {object} metadata of AvailableProviderOperationDisplay - * - */ - mapper() { - return { - required: false, - serializedName: 'AvailableProviderOperationDisplay', - type: { - name: 'Composite', - className: 'AvailableProviderOperationDisplay', - modelProperties: { - provider: { - required: false, - serializedName: 'provider', - type: { - name: 'String' - } - }, - resource: { - required: false, - serializedName: 'resource', - type: { - name: 'String' - } - }, - operation: { - required: false, - serializedName: 'operation', - type: { - name: 'String' - } - }, - description: { - required: false, - serializedName: 'description', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AvailableProviderOperationDisplay; diff --git a/lib/services/storSimple1200Series/lib/models/availableProviderOperations.js b/lib/services/storSimple1200Series/lib/models/availableProviderOperations.js deleted file mode 100644 index e500f7630c..0000000000 --- a/lib/services/storSimple1200Series/lib/models/availableProviderOperations.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Class for set of operations used for discovery of available provider - * operations. - */ -class AvailableProviderOperations extends Array { - /** - * Create a AvailableProviderOperations. - * @member {string} [nextLink] The NextLink. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of AvailableProviderOperations - * - * @returns {object} metadata of AvailableProviderOperations - * - */ - mapper() { - return { - required: false, - serializedName: 'AvailableProviderOperations', - type: { - name: 'Composite', - className: 'AvailableProviderOperations', - modelProperties: { - value: { - required: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'AvailableProviderOperationElementType', - type: { - name: 'Composite', - className: 'AvailableProviderOperation' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AvailableProviderOperations; diff --git a/lib/services/storSimple1200Series/lib/models/backup.js b/lib/services/storSimple1200Series/lib/models/backup.js deleted file mode 100644 index dfccfacf79..0000000000 --- a/lib/services/storSimple1200Series/lib/models/backup.js +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The backup. - * - * @extends models['BaseModel'] - */ -class Backup extends models['BaseModel'] { - /** - * Create a Backup. - * @member {string} [targetId] The path id of the target FileServer or - * IscsiServer for which the backup was taken. - * @member {string} [targetType] Type of target, FileServer or IscsiServer - * @member {number} sizeInBytes The backup size in bytes. - * @member {date} [createdTime] The time when the backup was created. - * @member {date} [expirationTime] The time when the backup will expire. - * @member {string} initiatedBy Indicates how the backup was initiated - * "Manual | Scheduled". Possible values include: 'Manual', 'Scheduled' - * @member {string} deviceId The Device Identifier. - * @member {array} elements The backup elements. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of Backup - * - * @returns {object} metadata of Backup - * - */ - mapper() { - return { - required: false, - serializedName: 'Backup', - type: { - name: 'Composite', - className: 'Backup', - 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' - } - }, - targetId: { - required: false, - serializedName: 'properties.targetId', - type: { - name: 'String' - } - }, - targetType: { - required: false, - serializedName: 'properties.targetType', - type: { - name: 'String' - } - }, - sizeInBytes: { - required: true, - serializedName: 'properties.sizeInBytes', - type: { - name: 'Number' - } - }, - createdTime: { - required: false, - serializedName: 'properties.createdTime', - type: { - name: 'DateTime' - } - }, - expirationTime: { - required: false, - serializedName: 'properties.expirationTime', - type: { - name: 'DateTime' - } - }, - initiatedBy: { - required: true, - serializedName: 'properties.initiatedBy', - type: { - name: 'Enum', - allowedValues: [ 'Manual', 'Scheduled' ] - } - }, - deviceId: { - required: true, - serializedName: 'properties.deviceId', - type: { - name: 'String' - } - }, - elements: { - required: true, - serializedName: 'properties.elements', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'BackupElementElementType', - type: { - name: 'Composite', - className: 'BackupElement' - } - } - } - } - } - } - }; - } -} - -module.exports = Backup; diff --git a/lib/services/storSimple1200Series/lib/models/backupElement.js b/lib/services/storSimple1200Series/lib/models/backupElement.js deleted file mode 100644 index 40758e45e9..0000000000 --- a/lib/services/storSimple1200Series/lib/models/backupElement.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Class represents BackupElement - * - * @extends models['BaseModel'] - */ -class BackupElement extends models['BaseModel'] { - /** - * Create a BackupElement. - * @member {number} sizeInBytes The size in bytes. - * @member {string} endpointName The name of the endpoint. - * @member {string} dataPolicy The data policy of backed up endpoint. - * Possible values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - */ - constructor() { - super(); - } - - /** - * Defines the metadata of BackupElement - * - * @returns {object} metadata of BackupElement - * - */ - mapper() { - return { - required: false, - serializedName: 'BackupElement', - type: { - name: 'Composite', - className: 'BackupElement', - 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' - } - }, - sizeInBytes: { - required: true, - serializedName: 'properties.sizeInBytes', - type: { - name: 'Number' - } - }, - endpointName: { - required: true, - serializedName: 'properties.endpointName', - type: { - name: 'String' - } - }, - dataPolicy: { - required: true, - serializedName: 'properties.dataPolicy', - type: { - name: 'Enum', - allowedValues: [ 'Invalid', 'Local', 'Tiered', 'Cloud' ] - } - } - } - } - }; - } -} - -module.exports = BackupElement; diff --git a/lib/services/storSimple1200Series/lib/models/backupFilter.js b/lib/services/storSimple1200Series/lib/models/backupFilter.js deleted file mode 100644 index 023c89aea6..0000000000 --- a/lib/services/storSimple1200Series/lib/models/backupFilter.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Backup OData filter class - * - */ -class BackupFilter { - /** - * Create a BackupFilter. - * @member {string} [initiatedBy] Gets or sets InitiatedBy. Possible values - * include: 'Manual', 'Scheduled' - * @member {date} [createdTime] Gets or sets CreatedTime - */ - constructor() { - } - - /** - * Defines the metadata of BackupFilter - * - * @returns {object} metadata of BackupFilter - * - */ - mapper() { - return { - required: false, - serializedName: 'BackupFilter', - type: { - name: 'Composite', - className: 'BackupFilter', - modelProperties: { - initiatedBy: { - required: false, - serializedName: 'initiatedBy', - type: { - name: 'Enum', - allowedValues: [ 'Manual', 'Scheduled' ] - } - }, - createdTime: { - required: false, - serializedName: 'createdTime', - type: { - name: 'DateTime' - } - } - } - } - }; - } -} - -module.exports = BackupFilter; diff --git a/lib/services/storSimple1200Series/lib/models/backupList.js b/lib/services/storSimple1200Series/lib/models/backupList.js deleted file mode 100644 index 2822846a45..0000000000 --- a/lib/services/storSimple1200Series/lib/models/backupList.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Collection of backups - */ -class BackupList extends Array { - /** - * Create a BackupList. - * @member {string} [nextLink] The NextLink. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of BackupList - * - * @returns {object} metadata of BackupList - * - */ - mapper() { - return { - required: false, - serializedName: 'BackupList', - type: { - name: 'Composite', - className: 'BackupList', - modelProperties: { - value: { - required: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'BackupElementType', - type: { - name: 'Composite', - className: 'Backup' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = BackupList; diff --git a/lib/services/storSimple1200Series/lib/models/backupScheduleGroup.js b/lib/services/storSimple1200Series/lib/models/backupScheduleGroup.js deleted file mode 100644 index 39a9308571..0000000000 --- a/lib/services/storSimple1200Series/lib/models/backupScheduleGroup.js +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The Backup Schedule Group - * - * @extends models['BaseModel'] - */ -class BackupScheduleGroup extends models['BaseModel'] { - /** - * Create a BackupScheduleGroup. - * @member {object} startTime The start time. When this field is specified we - * will generate Default GrandFather Father Son Backup Schedules. - * @member {number} [startTime.hour] The hour. - * @member {number} [startTime.minute] The minute. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of BackupScheduleGroup - * - * @returns {object} metadata of BackupScheduleGroup - * - */ - mapper() { - return { - required: false, - serializedName: 'BackupScheduleGroup', - type: { - name: 'Composite', - className: 'BackupScheduleGroup', - 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' - } - }, - startTime: { - required: true, - serializedName: 'properties.startTime', - type: { - name: 'Composite', - className: 'Time' - } - } - } - } - }; - } -} - -module.exports = BackupScheduleGroup; diff --git a/lib/services/storSimple1200Series/lib/models/backupScheduleGroupList.js b/lib/services/storSimple1200Series/lib/models/backupScheduleGroupList.js deleted file mode 100644 index cf86cd745f..0000000000 --- a/lib/services/storSimple1200Series/lib/models/backupScheduleGroupList.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * The list response of backup schedule groups - */ -class BackupScheduleGroupList extends Array { - /** - * Create a BackupScheduleGroupList. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of BackupScheduleGroupList - * - * @returns {object} metadata of BackupScheduleGroupList - * - */ - mapper() { - return { - required: false, - serializedName: 'BackupScheduleGroupList', - type: { - name: 'Composite', - className: 'BackupScheduleGroupList', - modelProperties: { - value: { - required: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'BackupScheduleGroupElementType', - type: { - name: 'Composite', - className: 'BackupScheduleGroup' - } - } - } - } - } - } - }; - } -} - -module.exports = BackupScheduleGroupList; diff --git a/lib/services/storSimple1200Series/lib/models/baseModel.js b/lib/services/storSimple1200Series/lib/models/baseModel.js deleted file mode 100644 index d347b700a4..0000000000 --- a/lib/services/storSimple1200Series/lib/models/baseModel.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Base class for models - * - */ -class BaseModel { - /** - * Create a BaseModel. - * @member {string} [id] The identifier. - * @member {string} [name] The name. - * @member {string} [type] The type. - */ - constructor() { - } - - /** - * Defines the metadata of BaseModel - * - * @returns {object} metadata of BaseModel - * - */ - mapper() { - return { - required: false, - serializedName: 'BaseModel', - type: { - name: 'Composite', - className: 'BaseModel', - 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 = BaseModel; diff --git a/lib/services/storSimple1200Series/lib/models/chapSettings.js b/lib/services/storSimple1200Series/lib/models/chapSettings.js deleted file mode 100644 index 29dfad51d2..0000000000 --- a/lib/services/storSimple1200Series/lib/models/chapSettings.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Challenge-Handshake Authentical Protocol (CHAP) setting - * - * @extends models['BaseModel'] - */ -class ChapSettings extends models['BaseModel'] { - /** - * Create a ChapSettings. - * @member {object} password The chap password. - * @member {string} [password.value] The value of the secret itself. If the - * secret is in plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. - * @member {string} [password.encryptionCertificateThumbprint] Thumbprint - * certificate that was used to encrypt "Value" - * @member {string} [password.encryptionAlgorithm] Algorithm used to encrypt - * "Value". Possible values include: 'None', 'AES256', 'RSAES_PKCS1_v_1_5' - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ChapSettings - * - * @returns {object} metadata of ChapSettings - * - */ - mapper() { - return { - required: false, - serializedName: 'ChapSettings', - type: { - name: 'Composite', - className: 'ChapSettings', - 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' - } - }, - password: { - required: true, - serializedName: 'properties.password', - type: { - name: 'Composite', - className: 'AsymmetricEncryptedSecret' - } - } - } - } - }; - } -} - -module.exports = ChapSettings; diff --git a/lib/services/storSimple1200Series/lib/models/chapSettingsList.js b/lib/services/storSimple1200Series/lib/models/chapSettingsList.js deleted file mode 100644 index 6bb6640bca..0000000000 --- a/lib/services/storSimple1200Series/lib/models/chapSettingsList.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Collection of Chap setting entities - */ -class ChapSettingsList extends Array { - /** - * Create a ChapSettingsList. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ChapSettingsList - * - * @returns {object} metadata of ChapSettingsList - * - */ - mapper() { - return { - required: false, - serializedName: 'ChapSettingsList', - type: { - name: 'Composite', - className: 'ChapSettingsList', - modelProperties: { - value: { - required: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ChapSettingsElementType', - type: { - name: 'Composite', - className: 'ChapSettings' - } - } - } - } - } - } - }; - } -} - -module.exports = ChapSettingsList; diff --git a/lib/services/storSimple1200Series/lib/models/clearAlertRequest.js b/lib/services/storSimple1200Series/lib/models/clearAlertRequest.js deleted file mode 100644 index 06dee7b98c..0000000000 --- a/lib/services/storSimple1200Series/lib/models/clearAlertRequest.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Request for clearing the alert - * - */ -class ClearAlertRequest { - /** - * Create a ClearAlertRequest. - * @member {string} [resolutionMessage] Resolution message while clearing the - * request - * @member {array} alerts List of alert Ids to be cleared - */ - constructor() { - } - - /** - * Defines the metadata of ClearAlertRequest - * - * @returns {object} metadata of ClearAlertRequest - * - */ - mapper() { - return { - required: false, - serializedName: 'ClearAlertRequest', - type: { - name: 'Composite', - className: 'ClearAlertRequest', - modelProperties: { - resolutionMessage: { - required: false, - serializedName: 'resolutionMessage', - type: { - name: 'String' - } - }, - alerts: { - required: true, - serializedName: 'alerts', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = ClearAlertRequest; diff --git a/lib/services/storSimple1200Series/lib/models/cloneRequest.js b/lib/services/storSimple1200Series/lib/models/cloneRequest.js deleted file mode 100644 index fb727b4097..0000000000 --- a/lib/services/storSimple1200Series/lib/models/cloneRequest.js +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Clone Job Request Model. - * - */ -class CloneRequest { - /** - * Create a CloneRequest. - * @member {string} targetDeviceId DeviceId of the device which will act as - * the Clone target - * @member {string} targetAccessPointId Accesspoint Id on which clone job - * will performed. - * @member {string} newEndpointName Name of new endpoint which will created - * as part of clone job. - * @member {object} [share] Share Object. - * @member {string} [share.description] Description for file share - * @member {string} [share.shareStatus] The Share Status. Possible values - * include: 'Online', 'Offline' - * @member {string} [share.dataPolicy] The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * @member {string} [share.adminUser] The user/group who will have full - * permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * @member {number} [share.provisionedCapacityInBytes] The total provisioned - * capacity in Bytes - * @member {number} [share.usedCapacityInBytes] The used capacity in Bytes. - * @member {number} [share.localUsedCapacityInBytes] The local used capacity - * in Bytes. - * @member {string} [share.monitoringStatus] The monitoring status. Possible - * values include: 'Enabled', 'Disabled' - * @member {object} [disk] Disk Object - * @member {string} [disk.description] The description. - * @member {string} [disk.diskStatus] The disk status. Possible values - * include: 'Online', 'Offline' - * @member {array} [disk.accessControlRecords] The access control records. - * @member {string} [disk.dataPolicy] The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * @member {number} [disk.provisionedCapacityInBytes] The provisioned - * capacity in bytes. - * @member {number} [disk.usedCapacityInBytes] The used capacity in bytes. - * @member {number} [disk.localUsedCapacityInBytes] The local used capacity - * in bytes. - * @member {string} [disk.monitoringStatus] The monitoring. Possible values - * include: 'Enabled', 'Disabled' - */ - constructor() { - } - - /** - * Defines the metadata of CloneRequest - * - * @returns {object} metadata of CloneRequest - * - */ - mapper() { - return { - required: false, - serializedName: 'CloneRequest', - type: { - name: 'Composite', - className: 'CloneRequest', - modelProperties: { - targetDeviceId: { - required: true, - serializedName: 'properties.targetDeviceId', - type: { - name: 'String' - } - }, - targetAccessPointId: { - required: true, - serializedName: 'properties.targetAccessPointId', - type: { - name: 'String' - } - }, - newEndpointName: { - required: true, - serializedName: 'properties.newEndpointName', - type: { - name: 'String' - } - }, - share: { - required: false, - serializedName: 'properties.share', - type: { - name: 'Composite', - className: 'FileShare' - } - }, - disk: { - required: false, - serializedName: 'properties.disk', - type: { - name: 'Composite', - className: 'ISCSIDisk' - } - } - } - } - }; - } -} - -module.exports = CloneRequest; diff --git a/lib/services/storSimple1200Series/lib/models/device.js b/lib/services/storSimple1200Series/lib/models/device.js deleted file mode 100644 index 48b64bb280..0000000000 --- a/lib/services/storSimple1200Series/lib/models/device.js +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Represents a StorSimple device object along with its properties - * - * @extends models['BaseModel'] - */ -class Device extends models['BaseModel'] { - /** - * Create a Device. - * @member {date} [activationTime] The UTC time at which the device was - * activated - * @member {array} [allowedDeviceOperations] Operations that are allowed on - * the device based on its current state - * @member {string} [culture] Language culture setting on the device. For eg: - * "en-US" - * @member {array} [deviceCapabilities] Device can be configured either as - * FileServer or IscsiServer - * @member {string} [deviceDescription] Short description given for the - * device - * @member {string} [domainName] Fully qualified name of the domain to which - * the device is attached - * @member {string} [deviceSoftwareVersion] Version number of the software - * running on the device - * @member {string} [friendlySoftwareName] Friendly name for the software - * version - * @member {string} [deviceConfigurationStatus] "Complete" if the device has - * been successfully registered as File/IscsiServer and the creation of - * share/volume is complete, "Pending" if the device is only registered but - * the creation of share/volume is complete is still pending. Possible values - * include: 'Complete', 'Pending' - * @member {string} [modelDescription] Name of the device model - * @member {string} [status] Current status of the device. Possible values - * include: 'Unknown', 'Online', 'Offline', 'RequiresAttention', - * 'MaintenanceMode', 'Creating', 'Provisioning', 'Deleted', 'ReadyToSetup', - * 'Deactivated', 'Deactivating' - * @member {string} [deviceType] Type of the device. Possible values include: - * 'Invalid', 'Appliance', 'VirtualAppliance', - * 'Series9000OnPremVirtualAppliance', 'Series9000VirtualAppliance', - * 'Series9000PhysicalAppliance' - * @member {object} [details] subclass containing more storage-related - * information about the device. This field will be populated only if the get - * call is made with $expand = details. - * @member {number} [details.endpointCount] Total number of endpoints that - * are currently on the device ( i.e. number of shares on FileServer or - * number of volumes on IscsiServer) - * @member {number} [details.totalStorageInBytes] Total storage available on - * the device in bytes. - * @member {number} [details.totalLocalStorageInBytes] Total local storage - * capacity in device in bytes. - * @member {number} [details.provisionedStorageInBytes] Storage in bytes that - * has been provisioned on the device including both local and cloud - * @member {number} [details.provisionedLocalStorageInBytes] Storage in bytes - * that has been provisioned locally on the device - * @member {number} [details.usingStorageInBytes] Storage that is being - * currently used in bytes including both local and cloud - * @member {number} [details.usingLocalStorageInBytes] Local Storage that is - * being currently used in bytes - * @member {number} [details.totalBackupSizeInBytes] Total size taken up by - * backups in bytes - * @member {number} [details.availableStorageInBytes] Total pending available - * storage on the device in bytes - * @member {number} [details.availableLocalStorageInBytes] Local pending - * storage available on the device in bytes - */ - constructor() { - super(); - } - - /** - * Defines the metadata of Device - * - * @returns {object} metadata of Device - * - */ - mapper() { - return { - required: false, - serializedName: 'Device', - type: { - name: 'Composite', - className: 'Device', - 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' - } - }, - activationTime: { - required: false, - serializedName: 'properties.activationTime', - type: { - name: 'DateTime' - } - }, - allowedDeviceOperations: { - required: false, - serializedName: 'properties.allowedDeviceOperations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'DeviceOperationElementType', - type: { - name: 'Enum', - allowedValues: [ 'None', 'Delete', 'DeleteWithWarning', 'DRSource', 'DRTarget', 'Browsable', 'ReadOnlyForDR', 'Deactivate' ] - } - } - } - }, - culture: { - required: false, - serializedName: 'properties.culture', - type: { - name: 'String' - } - }, - deviceCapabilities: { - required: false, - serializedName: 'properties.deviceCapabilities', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'SupportedDeviceCapabilitiesElementType', - type: { - name: 'Enum', - allowedValues: [ 'Invalid', 'FileServer', 'IscsiServer' ] - } - } - } - }, - deviceDescription: { - required: false, - serializedName: 'properties.deviceDescription', - type: { - name: 'String' - } - }, - domainName: { - required: false, - serializedName: 'properties.domainName', - type: { - name: 'String' - } - }, - deviceSoftwareVersion: { - required: false, - serializedName: 'properties.deviceSoftwareVersion', - type: { - name: 'String' - } - }, - friendlySoftwareName: { - required: false, - serializedName: 'properties.friendlySoftwareName', - type: { - name: 'String' - } - }, - deviceConfigurationStatus: { - required: false, - serializedName: 'properties.deviceConfigurationStatus', - type: { - name: 'Enum', - allowedValues: [ 'Complete', 'Pending' ] - } - }, - modelDescription: { - required: false, - serializedName: 'properties.modelDescription', - type: { - name: 'String' - } - }, - status: { - required: false, - serializedName: 'properties.status', - type: { - name: 'Enum', - allowedValues: [ 'Unknown', 'Online', 'Offline', 'RequiresAttention', 'MaintenanceMode', 'Creating', 'Provisioning', 'Deleted', 'ReadyToSetup', 'Deactivated', 'Deactivating' ] - } - }, - deviceType: { - required: false, - serializedName: 'properties.type', - type: { - name: 'Enum', - allowedValues: [ 'Invalid', 'Appliance', 'VirtualAppliance', 'Series9000OnPremVirtualAppliance', 'Series9000VirtualAppliance', 'Series9000PhysicalAppliance' ] - } - }, - details: { - required: false, - serializedName: 'properties.details', - type: { - name: 'Composite', - className: 'DeviceDetails' - } - } - } - } - }; - } -} - -module.exports = Device; diff --git a/lib/services/storSimple1200Series/lib/models/deviceDetails.js b/lib/services/storSimple1200Series/lib/models/deviceDetails.js deleted file mode 100644 index e927a59d19..0000000000 --- a/lib/services/storSimple1200Series/lib/models/deviceDetails.js +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Class containing more granular details about the device - * - */ -class DeviceDetails { - /** - * Create a DeviceDetails. - * @member {number} [endpointCount] Total number of endpoints that are - * currently on the device ( i.e. number of shares on FileServer or number of - * volumes on IscsiServer) - * @member {number} [totalStorageInBytes] Total storage available on the - * device in bytes. - * @member {number} [totalLocalStorageInBytes] Total local storage capacity - * in device in bytes. - * @member {number} [provisionedStorageInBytes] Storage in bytes that has - * been provisioned on the device including both local and cloud - * @member {number} [provisionedLocalStorageInBytes] Storage in bytes that - * has been provisioned locally on the device - * @member {number} [usingStorageInBytes] Storage that is being currently - * used in bytes including both local and cloud - * @member {number} [usingLocalStorageInBytes] Local Storage that is being - * currently used in bytes - * @member {number} [totalBackupSizeInBytes] Total size taken up by backups - * in bytes - * @member {number} [availableStorageInBytes] Total pending available storage - * on the device in bytes - * @member {number} [availableLocalStorageInBytes] Local pending storage - * available on the device in bytes - */ - constructor() { - } - - /** - * Defines the metadata of DeviceDetails - * - * @returns {object} metadata of DeviceDetails - * - */ - mapper() { - return { - required: false, - serializedName: 'DeviceDetails', - type: { - name: 'Composite', - className: 'DeviceDetails', - modelProperties: { - endpointCount: { - required: false, - serializedName: 'endpointCount', - type: { - name: 'Number' - } - }, - totalStorageInBytes: { - required: false, - serializedName: 'totalStorageInBytes', - type: { - name: 'Number' - } - }, - totalLocalStorageInBytes: { - required: false, - serializedName: 'totalLocalStorageInBytes', - type: { - name: 'Number' - } - }, - provisionedStorageInBytes: { - required: false, - serializedName: 'provisionedStorageInBytes', - type: { - name: 'Number' - } - }, - provisionedLocalStorageInBytes: { - required: false, - serializedName: 'provisionedLocalStorageInBytes', - type: { - name: 'Number' - } - }, - usingStorageInBytes: { - required: false, - serializedName: 'usingStorageInBytes', - type: { - name: 'Number' - } - }, - usingLocalStorageInBytes: { - required: false, - serializedName: 'usingLocalStorageInBytes', - type: { - name: 'Number' - } - }, - totalBackupSizeInBytes: { - required: false, - serializedName: 'totalBackupSizeInBytes', - type: { - name: 'Number' - } - }, - availableStorageInBytes: { - required: false, - serializedName: 'availableStorageInBytes', - type: { - name: 'Number' - } - }, - availableLocalStorageInBytes: { - required: false, - serializedName: 'availableLocalStorageInBytes', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = DeviceDetails; diff --git a/lib/services/storSimple1200Series/lib/models/deviceList.js b/lib/services/storSimple1200Series/lib/models/deviceList.js deleted file mode 100644 index cc3750491e..0000000000 --- a/lib/services/storSimple1200Series/lib/models/deviceList.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Collection of Devices - */ -class DeviceList extends Array { - /** - * Create a DeviceList. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of DeviceList - * - * @returns {object} metadata of DeviceList - * - */ - mapper() { - return { - required: false, - serializedName: 'DeviceList', - type: { - name: 'Composite', - className: 'DeviceList', - modelProperties: { - value: { - required: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'DeviceElementType', - type: { - name: 'Composite', - className: 'Device' - } - } - } - } - } - } - }; - } -} - -module.exports = DeviceList; diff --git a/lib/services/storSimple1200Series/lib/models/devicePatch.js b/lib/services/storSimple1200Series/lib/models/devicePatch.js deleted file mode 100644 index ea40cfc8ee..0000000000 --- a/lib/services/storSimple1200Series/lib/models/devicePatch.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Class that represents the Input for the PATCH call on Device. Currently the - * only patchable property on device is "DeviceDescription" - * - */ -class DevicePatch { - /** - * Create a DevicePatch. - * @member {string} [deviceDescription] Short description given for the - * device - */ - constructor() { - } - - /** - * Defines the metadata of DevicePatch - * - * @returns {object} metadata of DevicePatch - * - */ - mapper() { - return { - required: false, - serializedName: 'DevicePatch', - type: { - name: 'Composite', - className: 'DevicePatch', - modelProperties: { - deviceDescription: { - required: false, - serializedName: 'deviceDescription', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = DevicePatch; diff --git a/lib/services/storSimple1200Series/lib/models/encryptionSettings.js b/lib/services/storSimple1200Series/lib/models/encryptionSettings.js deleted file mode 100644 index bed2586cf9..0000000000 --- a/lib/services/storSimple1200Series/lib/models/encryptionSettings.js +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The EncryptionSettings - * - * @extends models['BaseModel'] - */ -class EncryptionSettings extends models['BaseModel'] { - /** - * Create a EncryptionSettings. - * @member {string} encryptionStatus The encryption status which indicates if - * encryption is enabled or not. Possible values include: 'Enabled', - * 'Disabled' - * @member {string} keyRolloverStatus The key rollover status which indicates - * if key rollover is required or not. If secrets encryption has been - * upgraded, then it requires key rollover. Possible values include: - * 'Required', 'NotRequired' - */ - constructor() { - super(); - } - - /** - * Defines the metadata of EncryptionSettings - * - * @returns {object} metadata of EncryptionSettings - * - */ - mapper() { - return { - required: false, - serializedName: 'EncryptionSettings', - type: { - name: 'Composite', - className: 'EncryptionSettings', - 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' - } - }, - encryptionStatus: { - required: true, - serializedName: 'properties.encryptionStatus', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - }, - keyRolloverStatus: { - required: true, - serializedName: 'properties.keyRolloverStatus', - type: { - name: 'Enum', - allowedValues: [ 'Required', 'NotRequired' ] - } - } - } - } - }; - } -} - -module.exports = EncryptionSettings; diff --git a/lib/services/storSimple1200Series/lib/models/errorModel.js b/lib/services/storSimple1200Series/lib/models/errorModel.js deleted file mode 100644 index dd6a796b94..0000000000 --- a/lib/services/storSimple1200Series/lib/models/errorModel.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Class representing a ErrorModel. - */ -class ErrorModel { - /** - * Create a ErrorModel. - * @member {string} errorCode - * @member {object} message - * @member {string} [message.language] - * @member {string} [message.value] - * @member {array} [values] - */ - constructor() { - } - - /** - * Defines the metadata of ErrorModel - * - * @returns {object} metadata of ErrorModel - * - */ - mapper() { - return { - required: false, - serializedName: 'Error', - type: { - name: 'Composite', - className: 'ErrorModel', - modelProperties: { - errorCode: { - required: true, - serializedName: 'errorCode', - type: { - name: 'String' - } - }, - message: { - required: true, - serializedName: 'message', - type: { - name: 'Composite', - className: 'Message' - } - }, - values: { - required: false, - serializedName: 'values', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ItemElementType', - type: { - name: 'Composite', - className: 'Item' - } - } - } - } - } - } - }; - } -} - -module.exports = ErrorModel; diff --git a/lib/services/storSimple1200Series/lib/models/failoverRequest.js b/lib/services/storSimple1200Series/lib/models/failoverRequest.js deleted file mode 100644 index 86cba0b448..0000000000 --- a/lib/services/storSimple1200Series/lib/models/failoverRequest.js +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * The Failover request object. - * - */ -class FailoverRequest { - /** - * Create a FailoverRequest. - * @member {array} [accesspointIds] - * @member {string} [targetDeviceId] - * @member {boolean} [skipValidation] - * @member {boolean} [keepSourceDevice] - */ - constructor() { - } - - /** - * Defines the metadata of FailoverRequest - * - * @returns {object} metadata of FailoverRequest - * - */ - mapper() { - return { - required: false, - serializedName: 'FailoverRequest', - type: { - name: 'Composite', - className: 'FailoverRequest', - modelProperties: { - accesspointIds: { - required: false, - serializedName: 'accesspointIds', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - targetDeviceId: { - required: false, - serializedName: 'targetDeviceId', - type: { - name: 'String' - } - }, - skipValidation: { - required: false, - serializedName: 'skipValidation', - type: { - name: 'Boolean' - } - }, - keepSourceDevice: { - required: false, - serializedName: 'keepSourceDevice', - type: { - name: 'Boolean' - } - } - } - } - }; - } -} - -module.exports = FailoverRequest; diff --git a/lib/services/storSimple1200Series/lib/models/fileServer.js b/lib/services/storSimple1200Series/lib/models/fileServer.js deleted file mode 100644 index fe461720f3..0000000000 --- a/lib/services/storSimple1200Series/lib/models/fileServer.js +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The file server. - * - * @extends models['BaseModel'] - */ -class FileServer extends models['BaseModel'] { - /** - * Create a FileServer. - * @member {string} domainName Domain of the file server - * @member {string} storageDomainId The storage domain id. - * @member {string} backupScheduleGroupId The backup policy id. - * @member {string} [description] The description of the file server - */ - constructor() { - super(); - } - - /** - * Defines the metadata of FileServer - * - * @returns {object} metadata of FileServer - * - */ - mapper() { - return { - required: false, - serializedName: 'FileServer', - type: { - name: 'Composite', - className: 'FileServer', - 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' - } - }, - domainName: { - required: true, - serializedName: 'properties.domainName', - type: { - name: 'String' - } - }, - storageDomainId: { - required: true, - serializedName: 'properties.storageDomainId', - type: { - name: 'String' - } - }, - backupScheduleGroupId: { - required: true, - serializedName: 'properties.backupScheduleGroupId', - type: { - name: 'String' - } - }, - description: { - required: false, - serializedName: 'properties.description', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = FileServer; diff --git a/lib/services/storSimple1200Series/lib/models/fileServerList.js b/lib/services/storSimple1200Series/lib/models/fileServerList.js deleted file mode 100644 index 50b43349b2..0000000000 --- a/lib/services/storSimple1200Series/lib/models/fileServerList.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Collection of file servers - */ -class FileServerList extends Array { - /** - * Create a FileServerList. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of FileServerList - * - * @returns {object} metadata of FileServerList - * - */ - mapper() { - return { - required: false, - serializedName: 'FileServerList', - type: { - name: 'Composite', - className: 'FileServerList', - modelProperties: { - value: { - required: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'FileServerElementType', - type: { - name: 'Composite', - className: 'FileServer' - } - } - } - } - } - } - }; - } -} - -module.exports = FileServerList; diff --git a/lib/services/storSimple1200Series/lib/models/fileShare.js b/lib/services/storSimple1200Series/lib/models/fileShare.js deleted file mode 100644 index d379beb79c..0000000000 --- a/lib/services/storSimple1200Series/lib/models/fileShare.js +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The File Share. - * - * @extends models['BaseModel'] - */ -class FileShare extends models['BaseModel'] { - /** - * Create a FileShare. - * @member {string} [description] Description for file share - * @member {string} shareStatus The Share Status. Possible values include: - * 'Online', 'Offline' - * @member {string} dataPolicy The data policy. Possible values include: - * 'Invalid', 'Local', 'Tiered', 'Cloud' - * @member {string} adminUser The user/group who will have full permission in - * this share. Active directory email address. Example: xyz@contoso.com or - * Contoso\xyz. - * @member {number} provisionedCapacityInBytes The total provisioned capacity - * in Bytes - * @member {number} [usedCapacityInBytes] The used capacity in Bytes. - * @member {number} [localUsedCapacityInBytes] The local used capacity in - * Bytes. - * @member {string} monitoringStatus The monitoring status. Possible values - * include: 'Enabled', 'Disabled' - */ - constructor() { - super(); - } - - /** - * Defines the metadata of FileShare - * - * @returns {object} metadata of FileShare - * - */ - mapper() { - return { - required: false, - serializedName: 'FileShare', - type: { - name: 'Composite', - className: 'FileShare', - 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' - } - }, - description: { - required: false, - serializedName: 'properties.description', - type: { - name: 'String' - } - }, - shareStatus: { - required: true, - serializedName: 'properties.shareStatus', - type: { - name: 'Enum', - allowedValues: [ 'Online', 'Offline' ] - } - }, - dataPolicy: { - required: true, - serializedName: 'properties.dataPolicy', - type: { - name: 'Enum', - allowedValues: [ 'Invalid', 'Local', 'Tiered', 'Cloud' ] - } - }, - adminUser: { - required: true, - serializedName: 'properties.adminUser', - type: { - name: 'String' - } - }, - provisionedCapacityInBytes: { - required: true, - serializedName: 'properties.provisionedCapacityInBytes', - type: { - name: 'Number' - } - }, - usedCapacityInBytes: { - required: false, - readOnly: true, - serializedName: 'properties.usedCapacityInBytes', - type: { - name: 'Number' - } - }, - localUsedCapacityInBytes: { - required: false, - readOnly: true, - serializedName: 'properties.localUsedCapacityInBytes', - type: { - name: 'Number' - } - }, - monitoringStatus: { - required: true, - serializedName: 'properties.monitoringStatus', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - } - } - } - }; - } -} - -module.exports = FileShare; diff --git a/lib/services/storSimple1200Series/lib/models/fileShareList.js b/lib/services/storSimple1200Series/lib/models/fileShareList.js deleted file mode 100644 index 42f50622df..0000000000 --- a/lib/services/storSimple1200Series/lib/models/fileShareList.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Collection of file shares - */ -class FileShareList extends Array { - /** - * Create a FileShareList. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of FileShareList - * - * @returns {object} metadata of FileShareList - * - */ - mapper() { - return { - required: false, - serializedName: 'FileShareList', - type: { - name: 'Composite', - className: 'FileShareList', - modelProperties: { - value: { - required: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'FileShareElementType', - type: { - name: 'Composite', - className: 'FileShare' - } - } - } - } - } - } - }; - } -} - -module.exports = FileShareList; diff --git a/lib/services/storSimple1200Series/lib/models/iPConfig.js b/lib/services/storSimple1200Series/lib/models/iPConfig.js deleted file mode 100644 index 93e0be9192..0000000000 --- a/lib/services/storSimple1200Series/lib/models/iPConfig.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Details related to the IP address configuration - * - */ -class IPConfig { - /** - * Create a IPConfig. - * @member {string} ipAddress The ipaddress of the network adapter, either - * ipv4 or ipv6. - * @member {number} [prefixLength] The prefix length of the network adapter. - * @member {string} gateway The gateway of the network adapter. - */ - constructor() { - } - - /** - * Defines the metadata of IPConfig - * - * @returns {object} metadata of IPConfig - * - */ - mapper() { - return { - required: false, - serializedName: 'IPConfig', - type: { - name: 'Composite', - className: 'IPConfig', - modelProperties: { - ipAddress: { - required: true, - serializedName: 'ipAddress', - type: { - name: 'String' - } - }, - prefixLength: { - required: false, - serializedName: 'prefixLength', - type: { - name: 'Number' - } - }, - gateway: { - required: true, - serializedName: 'gateway', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = IPConfig; diff --git a/lib/services/storSimple1200Series/lib/models/iSCSIDisk.js b/lib/services/storSimple1200Series/lib/models/iSCSIDisk.js deleted file mode 100644 index b16b91c8eb..0000000000 --- a/lib/services/storSimple1200Series/lib/models/iSCSIDisk.js +++ /dev/null @@ -1,153 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The iscsi disk. - * - * @extends models['BaseModel'] - */ -class ISCSIDisk extends models['BaseModel'] { - /** - * Create a ISCSIDisk. - * @member {string} [description] The description. - * @member {string} diskStatus The disk status. Possible values include: - * 'Online', 'Offline' - * @member {array} accessControlRecords The access control records. - * @member {string} dataPolicy The data policy. Possible values include: - * 'Invalid', 'Local', 'Tiered', 'Cloud' - * @member {number} provisionedCapacityInBytes The provisioned capacity in - * bytes. - * @member {number} [usedCapacityInBytes] The used capacity in bytes. - * @member {number} [localUsedCapacityInBytes] The local used capacity in - * bytes. - * @member {string} monitoringStatus The monitoring. Possible values include: - * 'Enabled', 'Disabled' - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ISCSIDisk - * - * @returns {object} metadata of ISCSIDisk - * - */ - mapper() { - return { - required: false, - serializedName: 'ISCSIDisk', - type: { - name: 'Composite', - className: 'ISCSIDisk', - 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' - } - }, - description: { - required: false, - serializedName: 'properties.description', - type: { - name: 'String' - } - }, - diskStatus: { - required: true, - serializedName: 'properties.diskStatus', - type: { - name: 'Enum', - allowedValues: [ 'Online', 'Offline' ] - } - }, - accessControlRecords: { - required: true, - serializedName: 'properties.accessControlRecords', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - dataPolicy: { - required: true, - serializedName: 'properties.dataPolicy', - type: { - name: 'Enum', - allowedValues: [ 'Invalid', 'Local', 'Tiered', 'Cloud' ] - } - }, - provisionedCapacityInBytes: { - required: true, - serializedName: 'properties.provisionedCapacityInBytes', - type: { - name: 'Number' - } - }, - usedCapacityInBytes: { - required: false, - readOnly: true, - serializedName: 'properties.usedCapacityInBytes', - type: { - name: 'Number' - } - }, - localUsedCapacityInBytes: { - required: false, - readOnly: true, - serializedName: 'properties.localUsedCapacityInBytes', - type: { - name: 'Number' - } - }, - monitoringStatus: { - required: true, - serializedName: 'properties.monitoringStatus', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - } - } - } - }; - } -} - -module.exports = ISCSIDisk; diff --git a/lib/services/storSimple1200Series/lib/models/iSCSIDiskList.js b/lib/services/storSimple1200Series/lib/models/iSCSIDiskList.js deleted file mode 100644 index a03f9c4dc0..0000000000 --- a/lib/services/storSimple1200Series/lib/models/iSCSIDiskList.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Collection of Iscsi disk - */ -class ISCSIDiskList extends Array { - /** - * Create a ISCSIDiskList. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ISCSIDiskList - * - * @returns {object} metadata of ISCSIDiskList - * - */ - mapper() { - return { - required: false, - serializedName: 'ISCSIDiskList', - type: { - name: 'Composite', - className: 'ISCSIDiskList', - modelProperties: { - value: { - required: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ISCSIDiskElementType', - type: { - name: 'Composite', - className: 'ISCSIDisk' - } - } - } - } - } - } - }; - } -} - -module.exports = ISCSIDiskList; diff --git a/lib/services/storSimple1200Series/lib/models/iSCSIServer.js b/lib/services/storSimple1200Series/lib/models/iSCSIServer.js deleted file mode 100644 index d226d56688..0000000000 --- a/lib/services/storSimple1200Series/lib/models/iSCSIServer.js +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The iscsi server. - * - * @extends models['BaseModel'] - */ -class ISCSIServer extends models['BaseModel'] { - /** - * Create a ISCSIServer. - * @member {string} storageDomainId The storage domain id. - * @member {string} backupScheduleGroupId The backup policy id. - * @member {string} [description] The description. - * @member {string} [chapId] The chap id. - * @member {string} [reverseChapId] The reverse chap id. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ISCSIServer - * - * @returns {object} metadata of ISCSIServer - * - */ - mapper() { - return { - required: false, - serializedName: 'ISCSIServer', - type: { - name: 'Composite', - className: 'ISCSIServer', - 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' - } - }, - storageDomainId: { - required: true, - serializedName: 'properties.storageDomainId', - type: { - name: 'String' - } - }, - backupScheduleGroupId: { - required: true, - serializedName: 'properties.backupScheduleGroupId', - type: { - name: 'String' - } - }, - description: { - required: false, - serializedName: 'properties.description', - type: { - name: 'String' - } - }, - chapId: { - required: false, - serializedName: 'properties.chapId', - type: { - name: 'String' - } - }, - reverseChapId: { - required: false, - serializedName: 'properties.reverseChapId', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ISCSIServer; diff --git a/lib/services/storSimple1200Series/lib/models/iSCSIServerList.js b/lib/services/storSimple1200Series/lib/models/iSCSIServerList.js deleted file mode 100644 index 62473251c2..0000000000 --- a/lib/services/storSimple1200Series/lib/models/iSCSIServerList.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Collection of Iscsi servers - */ -class ISCSIServerList extends Array { - /** - * Create a ISCSIServerList. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ISCSIServerList - * - * @returns {object} metadata of ISCSIServerList - * - */ - mapper() { - return { - required: false, - serializedName: 'ISCSIServerList', - type: { - name: 'Composite', - className: 'ISCSIServerList', - modelProperties: { - value: { - required: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ISCSIServerElementType', - type: { - name: 'Composite', - className: 'ISCSIServer' - } - } - } - } - } - } - }; - } -} - -module.exports = ISCSIServerList; diff --git a/lib/services/storSimple1200Series/lib/models/index.d.ts b/lib/services/storSimple1200Series/lib/models/index.d.ts deleted file mode 100644 index 18441985f0..0000000000 --- a/lib/services/storSimple1200Series/lib/models/index.d.ts +++ /dev/null @@ -1,1766 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import { BaseResource } from 'ms-rest-azure'; -import { CloudError } from 'ms-rest-azure'; -import * as moment from 'moment'; - -export { BaseResource } from 'ms-rest-azure'; -export { CloudError } from 'ms-rest-azure'; - - -/** - * @class - * Initializes a new instance of the BaseModel class. - * @constructor - * Base class for models - * - * @member {string} [id] The identifier. - * @member {string} [name] The name. - * @member {string} [type] The type. - */ -export interface BaseModel { - readonly id?: string; - readonly name?: string; - readonly type?: string; -} - -/** - * @class - * Initializes a new instance of the AccessControlRecord class. - * @constructor - * The access control record - * - * @member {string} initiatorName The Iscsi initiator name (IQN) - */ -export interface AccessControlRecord extends BaseModel { - initiatorName: string; -} - -/** - * @class - * Initializes a new instance of the AlertSource class. - * @constructor - * source at which the alert can be raised - * - * @member {string} [name] Name of the source. - * @member {string} [timeZone] The time zone. - * @member {string} [alertSourceType] Source type of the alert. Possible values - * include: 'Resource', 'Device' - */ -export interface AlertSource { - name?: string; - timeZone?: string; - alertSourceType?: string; -} - -/** - * @class - * Initializes a new instance of the AlertErrorDetails class. - * @constructor - * Errordetails for the alert - * - * @member {string} [errorCode] Error code. - * @member {string} [errorMessage] Error Message - * @member {number} [occurences] Number of occurences. - */ -export interface AlertErrorDetails { - errorCode?: string; - errorMessage?: string; - occurences?: number; -} - -/** - * @class - * Initializes a new instance of the Alert class. - * @constructor - * Alert class - * - * @member {string} title Title of the alert - * @member {string} scope Device or Resource alert. Possible values include: - * 'Resource', 'Device' - * @member {string} alertType Type of the alert - * @member {date} appearedAtTime UTC time at which the alert appeared - * @member {date} appearedAtSourceTime UTC time at which the alert appeared on - * the source - * @member {date} [clearedAtTime] UTC time at which the alert got cleared - * @member {date} [clearedAtSourceTime] UTC time at which the alert was cleared - * on the source - * @member {object} source Source at which the alert was cleared - * @member {string} [source.name] Name of the source. - * @member {string} [source.timeZone] The time zone. - * @member {string} [source.alertSourceType] Source type of the alert. Possible - * values include: 'Resource', 'Device' - * @member {string} [recommendation] Recommendation for acting on the alert - * @member {string} [resolutionReason] Reason for resolving the alert - * @member {string} severity Severity of the alert. Possible values include: - * 'Informational', 'Warning', 'Critical' - * @member {string} status Current status of the alert. Possible values - * include: 'Active', 'Cleared' - * @member {object} [errorDetails] ErrorDetails of the alert - * @member {string} [errorDetails.errorCode] Error code. - * @member {string} [errorDetails.errorMessage] Error Message - * @member {number} [errorDetails.occurences] Number of occurences. - * @member {object} [detailedInformation] Other information about the alert - */ -export interface Alert extends BaseModel { - title: string; - scope: string; - alertType: string; - appearedAtTime: Date; - appearedAtSourceTime: Date; - clearedAtTime?: Date; - clearedAtSourceTime?: Date; - source: AlertSource; - recommendation?: string; - resolutionReason?: string; - severity: string; - status: string; - errorDetails?: AlertErrorDetails; - detailedInformation?: { [propertyName: string]: string }; -} - -/** - * @class - * Initializes a new instance of the AlertFilter class. - * @constructor - * Filters that can be specified on the alert - * - * @member {string} [status] Status of the alert. Possible values include: - * 'Active', 'Cleared' - * @member {string} [severity] Severity of the alert. Possible values include: - * 'Informational', 'Warning', 'Critical' - * @member {string} [sourceType] Source of the alert. Possible values include: - * 'Resource', 'Device' - * @member {string} [sourceName] Source name of the alert - * @member {date} [appearedOnTime] UTC time on which the alert appeared - */ -export interface AlertFilter { - status?: string; - severity?: string; - sourceType?: string; - sourceName?: string; - appearedOnTime?: Date; -} - -/** - * @class - * Initializes a new instance of the AlertSettings class. - * @constructor - * AlertSettings on the device which represents how alerts will be processed - * - * @member {string} emailNotification Value indicating whether user/admins will - * receive emails when an alert condition occurs on the system. Possible values - * include: 'Enabled', 'Disabled' - * @member {string} notificationToServiceOwners Value indicating whether - * service owners will receive emails when an alert condition occurs on the - * system. Applicable only if emailNotification flag is Enabled. Possible - * values include: 'Enabled', 'Disabled' - * @member {string} alertNotificationCulture Culture setting to be used while - * building alert emails. For eg: "en-US" - * @member {array} [additionalRecipientEmailList] List of email addresses - * (apart from admin/coadmin of subscription) to whom the alert emails need to - * be sent - */ -export interface AlertSettings extends BaseModel { - emailNotification: string; - notificationToServiceOwners: string; - alertNotificationCulture: string; - additionalRecipientEmailList?: string[]; -} - -/** - * @class - * Initializes a new instance of the AsymmetricEncryptedSecret class. - * @constructor - * This class can be used as the Type for any secret entity represented as - * Password, CertThumbprint, Algorithm. This class is intended to be used when - * the secret is encrypted with an asymmetric key pair. The encryptionAlgorithm - * field is mainly for future usage to potentially allow different entities - * encrypted using different algorithms. - * - * @member {string} value The value of the secret itself. If the secret is in - * plaintext then EncryptionAlgorithm will be none and EncryptionCertThumbprint - * will be null. - * @member {string} [encryptionCertificateThumbprint] Thumbprint certificate - * that was used to encrypt "Value" - * @member {string} encryptionAlgorithm Algorithm used to encrypt "Value". - * Possible values include: 'None', 'AES256', 'RSAES_PKCS1_v_1_5' - */ -export interface AsymmetricEncryptedSecret { - value: string; - encryptionCertificateThumbprint?: string; - encryptionAlgorithm: string; -} - -/** - * @class - * Initializes a new instance of the AvailableProviderOperationDisplay class. - * @constructor - * Contains the localized display information for this particular operation / - * action. - * These value will be used by several clients for - * (1) custom role definitions for RBAC; - * (2) complex query filters for the event service; and (3) audit history / - * records for management operations. - * - * @member {string} [provider] Gets or sets Provider - * The localized friendly form of the resource provider name – it is expected - * to also include the publisher/company responsible. - * It should use Title Casing and begin with “Microsoft” for 1st party - * services. - * @member {string} [resource] Gets or sets Resource - * The localized friendly form of the resource type related to this - * action/operation – it should match the public documentation for the resource - * provider. - * It should use Title Casing – for examples, please refer to the “name” - * section. - * @member {string} [operation] Gets or sets Operation - * The localized friendly name for the operation, as it should be shown to the - * user. - * It should be concise (to fit in drop downs) but clear (i.e. - * self-documenting). It should use Title Casing and include the - * entity/resource to which it applies. - * @member {string} [description] Gets or sets Description - * The localized friendly description for the operation, as it should be shown - * to the user. - * It should be thorough, yet concise – it will be used in tool tips and - * detailed views. - */ -export interface AvailableProviderOperationDisplay { - provider?: string; - resource?: string; - operation?: string; - description?: string; -} - -/** - * @class - * Initializes a new instance of the AvailableProviderOperation class. - * @constructor - * Class represents provider operation - * - * @member {string} [name] Gets or sets the name of the operation being - * performed on this particular object - * Return value format: - * "{resourceProviderNamespace}/{resourceType}/{read|write|deletion|action}" - * Eg: Microsoft.StorSimple/managers/devices/fileServers/read - * Microsoft.StorSimple/managers/devices/alerts/clearAlerts/action - * @member {object} [display] Gets or sets Display information - * Contains the localized display information for this particular - * operation/action - * @member {string} [display.provider] Gets or sets Provider - * The localized friendly form of the resource provider name – it is expected - * to also include the publisher/company responsible. - * It should use Title Casing and begin with “Microsoft” for 1st party - * services. - * @member {string} [display.resource] Gets or sets Resource - * The localized friendly form of the resource type related to this - * action/operation – it should match the public documentation for the resource - * provider. - * It should use Title Casing – for examples, please refer to the “name” - * section. - * @member {string} [display.operation] Gets or sets Operation - * The localized friendly name for the operation, as it should be shown to the - * user. - * It should be concise (to fit in drop downs) but clear (i.e. - * self-documenting). It should use Title Casing and include the - * entity/resource to which it applies. - * @member {string} [display.description] Gets or sets Description - * The localized friendly description for the operation, as it should be shown - * to the user. - * It should be thorough, yet concise – it will be used in tool tips and - * detailed views. - * @member {string} [origin] Gets or sets Origin - * The intended executor of the operation; governs the display of the operation - * in the RBAC UX and the audit logs UX. - * Default value is “user,system” - * @member {object} [properties] Gets or sets Properties - * Reserved for future use - */ -export interface AvailableProviderOperation { - name?: string; - display?: AvailableProviderOperationDisplay; - origin?: string; - properties?: any; -} - -/** - * @class - * Initializes a new instance of the BackupElement class. - * @constructor - * Class represents BackupElement - * - * @member {number} sizeInBytes The size in bytes. - * @member {string} endpointName The name of the endpoint. - * @member {string} dataPolicy The data policy of backed up endpoint. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - */ -export interface BackupElement extends BaseModel { - sizeInBytes: number; - endpointName: string; - dataPolicy: string; -} - -/** - * @class - * Initializes a new instance of the Backup class. - * @constructor - * The backup. - * - * @member {string} [targetId] The path id of the target FileServer or - * IscsiServer for which the backup was taken. - * @member {string} [targetType] Type of target, FileServer or IscsiServer - * @member {number} sizeInBytes The backup size in bytes. - * @member {date} [createdTime] The time when the backup was created. - * @member {date} [expirationTime] The time when the backup will expire. - * @member {string} initiatedBy Indicates how the backup was initiated "Manual - * | Scheduled". Possible values include: 'Manual', 'Scheduled' - * @member {string} deviceId The Device Identifier. - * @member {array} elements The backup elements. - */ -export interface Backup extends BaseModel { - targetId?: string; - targetType?: string; - sizeInBytes: number; - createdTime?: Date; - expirationTime?: Date; - initiatedBy: string; - deviceId: string; - elements: BackupElement[]; -} - -/** - * @class - * Initializes a new instance of the BackupFilter class. - * @constructor - * Backup OData filter class - * - * @member {string} [initiatedBy] Gets or sets InitiatedBy. Possible values - * include: 'Manual', 'Scheduled' - * @member {date} [createdTime] Gets or sets CreatedTime - */ -export interface BackupFilter { - initiatedBy?: string; - createdTime?: Date; -} - -/** - * @class - * Initializes a new instance of the Time class. - * @constructor - * The Time. - * - * @member {number} hour The hour. - * @member {number} minute The minute. - */ -export interface Time { - hour: number; - minute: number; -} - -/** - * @class - * Initializes a new instance of the BackupScheduleGroup class. - * @constructor - * The Backup Schedule Group - * - * @member {object} startTime The start time. When this field is specified we - * will generate Default GrandFather Father Son Backup Schedules. - * @member {number} [startTime.hour] The hour. - * @member {number} [startTime.minute] The minute. - */ -export interface BackupScheduleGroup extends BaseModel { - startTime: Time; -} - -/** - * @class - * Initializes a new instance of the ChapSettings class. - * @constructor - * Challenge-Handshake Authentical Protocol (CHAP) setting - * - * @member {object} password The chap password. - * @member {string} [password.value] The value of the secret itself. If the - * secret is in plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. - * @member {string} [password.encryptionCertificateThumbprint] Thumbprint - * certificate that was used to encrypt "Value" - * @member {string} [password.encryptionAlgorithm] Algorithm used to encrypt - * "Value". Possible values include: 'None', 'AES256', 'RSAES_PKCS1_v_1_5' - */ -export interface ChapSettings extends BaseModel { - password: AsymmetricEncryptedSecret; -} - -/** - * @class - * Initializes a new instance of the ClearAlertRequest class. - * @constructor - * Request for clearing the alert - * - * @member {string} [resolutionMessage] Resolution message while clearing the - * request - * @member {array} alerts List of alert Ids to be cleared - */ -export interface ClearAlertRequest { - resolutionMessage?: string; - alerts: string[]; -} - -/** - * @class - * Initializes a new instance of the FileShare class. - * @constructor - * The File Share. - * - * @member {string} [description] Description for file share - * @member {string} shareStatus The Share Status. Possible values include: - * 'Online', 'Offline' - * @member {string} dataPolicy The data policy. Possible values include: - * 'Invalid', 'Local', 'Tiered', 'Cloud' - * @member {string} adminUser The user/group who will have full permission in - * this share. Active directory email address. Example: xyz@contoso.com or - * Contoso\xyz. - * @member {number} provisionedCapacityInBytes The total provisioned capacity - * in Bytes - * @member {number} [usedCapacityInBytes] The used capacity in Bytes. - * @member {number} [localUsedCapacityInBytes] The local used capacity in - * Bytes. - * @member {string} monitoringStatus The monitoring status. Possible values - * include: 'Enabled', 'Disabled' - */ -export interface FileShare extends BaseModel { - description?: string; - shareStatus: string; - dataPolicy: string; - adminUser: string; - provisionedCapacityInBytes: number; - readonly usedCapacityInBytes?: number; - readonly localUsedCapacityInBytes?: number; - monitoringStatus: string; -} - -/** - * @class - * Initializes a new instance of the ISCSIDisk class. - * @constructor - * The iscsi disk. - * - * @member {string} [description] The description. - * @member {string} diskStatus The disk status. Possible values include: - * 'Online', 'Offline' - * @member {array} accessControlRecords The access control records. - * @member {string} dataPolicy The data policy. Possible values include: - * 'Invalid', 'Local', 'Tiered', 'Cloud' - * @member {number} provisionedCapacityInBytes The provisioned capacity in - * bytes. - * @member {number} [usedCapacityInBytes] The used capacity in bytes. - * @member {number} [localUsedCapacityInBytes] The local used capacity in - * bytes. - * @member {string} monitoringStatus The monitoring. Possible values include: - * 'Enabled', 'Disabled' - */ -export interface ISCSIDisk extends BaseModel { - description?: string; - diskStatus: string; - accessControlRecords: string[]; - dataPolicy: string; - provisionedCapacityInBytes: number; - readonly usedCapacityInBytes?: number; - readonly localUsedCapacityInBytes?: number; - monitoringStatus: string; -} - -/** - * @class - * Initializes a new instance of the CloneRequest class. - * @constructor - * Clone Job Request Model. - * - * @member {string} targetDeviceId DeviceId of the device which will act as the - * Clone target - * @member {string} targetAccessPointId Accesspoint Id on which clone job will - * performed. - * @member {string} newEndpointName Name of new endpoint which will created as - * part of clone job. - * @member {object} [share] Share Object. - * @member {string} [share.description] Description for file share - * @member {string} [share.shareStatus] The Share Status. Possible values - * include: 'Online', 'Offline' - * @member {string} [share.dataPolicy] The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * @member {string} [share.adminUser] The user/group who will have full - * permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * @member {number} [share.provisionedCapacityInBytes] The total provisioned - * capacity in Bytes - * @member {number} [share.usedCapacityInBytes] The used capacity in Bytes. - * @member {number} [share.localUsedCapacityInBytes] The local used capacity in - * Bytes. - * @member {string} [share.monitoringStatus] The monitoring status. Possible - * values include: 'Enabled', 'Disabled' - * @member {object} [disk] Disk Object - * @member {string} [disk.description] The description. - * @member {string} [disk.diskStatus] The disk status. Possible values include: - * 'Online', 'Offline' - * @member {array} [disk.accessControlRecords] The access control records. - * @member {string} [disk.dataPolicy] The data policy. Possible values include: - * 'Invalid', 'Local', 'Tiered', 'Cloud' - * @member {number} [disk.provisionedCapacityInBytes] The provisioned capacity - * in bytes. - * @member {number} [disk.usedCapacityInBytes] The used capacity in bytes. - * @member {number} [disk.localUsedCapacityInBytes] The local used capacity in - * bytes. - * @member {string} [disk.monitoringStatus] The monitoring. Possible values - * include: 'Enabled', 'Disabled' - */ -export interface CloneRequest { - targetDeviceId: string; - targetAccessPointId: string; - newEndpointName: string; - share?: FileShare; - disk?: ISCSIDisk; -} - -/** - * @class - * Initializes a new instance of the DeviceDetails class. - * @constructor - * Class containing more granular details about the device - * - * @member {number} [endpointCount] Total number of endpoints that are - * currently on the device ( i.e. number of shares on FileServer or number of - * volumes on IscsiServer) - * @member {number} [totalStorageInBytes] Total storage available on the device - * in bytes. - * @member {number} [totalLocalStorageInBytes] Total local storage capacity in - * device in bytes. - * @member {number} [provisionedStorageInBytes] Storage in bytes that has been - * provisioned on the device including both local and cloud - * @member {number} [provisionedLocalStorageInBytes] Storage in bytes that has - * been provisioned locally on the device - * @member {number} [usingStorageInBytes] Storage that is being currently used - * in bytes including both local and cloud - * @member {number} [usingLocalStorageInBytes] Local Storage that is being - * currently used in bytes - * @member {number} [totalBackupSizeInBytes] Total size taken up by backups in - * bytes - * @member {number} [availableStorageInBytes] Total pending available storage - * on the device in bytes - * @member {number} [availableLocalStorageInBytes] Local pending storage - * available on the device in bytes - */ -export interface DeviceDetails { - endpointCount?: number; - totalStorageInBytes?: number; - totalLocalStorageInBytes?: number; - provisionedStorageInBytes?: number; - provisionedLocalStorageInBytes?: number; - usingStorageInBytes?: number; - usingLocalStorageInBytes?: number; - totalBackupSizeInBytes?: number; - availableStorageInBytes?: number; - availableLocalStorageInBytes?: number; -} - -/** - * @class - * Initializes a new instance of the Device class. - * @constructor - * Represents a StorSimple device object along with its properties - * - * @member {date} [activationTime] The UTC time at which the device was - * activated - * @member {array} [allowedDeviceOperations] Operations that are allowed on the - * device based on its current state - * @member {string} [culture] Language culture setting on the device. For eg: - * "en-US" - * @member {array} [deviceCapabilities] Device can be configured either as - * FileServer or IscsiServer - * @member {string} [deviceDescription] Short description given for the device - * @member {string} [domainName] Fully qualified name of the domain to which - * the device is attached - * @member {string} [deviceSoftwareVersion] Version number of the software - * running on the device - * @member {string} [friendlySoftwareName] Friendly name for the software - * version - * @member {string} [deviceConfigurationStatus] "Complete" if the device has - * been successfully registered as File/IscsiServer and the creation of - * share/volume is complete, "Pending" if the device is only registered but the - * creation of share/volume is complete is still pending. Possible values - * include: 'Complete', 'Pending' - * @member {string} [modelDescription] Name of the device model - * @member {string} [status] Current status of the device. Possible values - * include: 'Unknown', 'Online', 'Offline', 'RequiresAttention', - * 'MaintenanceMode', 'Creating', 'Provisioning', 'Deleted', 'ReadyToSetup', - * 'Deactivated', 'Deactivating' - * @member {string} [deviceType] Type of the device. Possible values include: - * 'Invalid', 'Appliance', 'VirtualAppliance', - * 'Series9000OnPremVirtualAppliance', 'Series9000VirtualAppliance', - * 'Series9000PhysicalAppliance' - * @member {object} [details] subclass containing more storage-related - * information about the device. This field will be populated only if the get - * call is made with $expand = details. - * @member {number} [details.endpointCount] Total number of endpoints that are - * currently on the device ( i.e. number of shares on FileServer or number of - * volumes on IscsiServer) - * @member {number} [details.totalStorageInBytes] Total storage available on - * the device in bytes. - * @member {number} [details.totalLocalStorageInBytes] Total local storage - * capacity in device in bytes. - * @member {number} [details.provisionedStorageInBytes] Storage in bytes that - * has been provisioned on the device including both local and cloud - * @member {number} [details.provisionedLocalStorageInBytes] Storage in bytes - * that has been provisioned locally on the device - * @member {number} [details.usingStorageInBytes] Storage that is being - * currently used in bytes including both local and cloud - * @member {number} [details.usingLocalStorageInBytes] Local Storage that is - * being currently used in bytes - * @member {number} [details.totalBackupSizeInBytes] Total size taken up by - * backups in bytes - * @member {number} [details.availableStorageInBytes] Total pending available - * storage on the device in bytes - * @member {number} [details.availableLocalStorageInBytes] Local pending - * storage available on the device in bytes - */ -export interface Device extends BaseModel { - activationTime?: Date; - allowedDeviceOperations?: string[]; - culture?: string; - deviceCapabilities?: string[]; - deviceDescription?: string; - domainName?: string; - deviceSoftwareVersion?: string; - friendlySoftwareName?: string; - deviceConfigurationStatus?: string; - modelDescription?: string; - status?: string; - deviceType?: string; - details?: DeviceDetails; -} - -/** - * @class - * Initializes a new instance of the DevicePatch class. - * @constructor - * Class that represents the Input for the PATCH call on Device. Currently the - * only patchable property on device is "DeviceDescription" - * - * @member {string} [deviceDescription] Short description given for the device - */ -export interface DevicePatch { - deviceDescription?: string; -} - -/** - * @class - * Initializes a new instance of the EncryptionSettings class. - * @constructor - * The EncryptionSettings - * - * @member {string} encryptionStatus The encryption status which indicates if - * encryption is enabled or not. Possible values include: 'Enabled', 'Disabled' - * @member {string} keyRolloverStatus The key rollover status which indicates - * if key rollover is required or not. If secrets encryption has been upgraded, - * then it requires key rollover. Possible values include: 'Required', - * 'NotRequired' - */ -export interface EncryptionSettings extends BaseModel { - encryptionStatus: string; - keyRolloverStatus: string; -} - -/** - * @class - * Initializes a new instance of the Message class. - * @constructor - * @member {string} [language] - * @member {string} [value] - */ -export interface Message { - language?: string; - value?: string; -} - -/** - * @class - * Initializes a new instance of the Item class. - * @constructor - * @member {string} key - * @member {string} value - */ -export interface Item { - key: string; - value: string; -} - -/** - * @class - * Initializes a new instance of the ErrorModel class. - * @constructor - * @member {string} errorCode - * @member {object} message - * @member {string} [message.language] - * @member {string} [message.value] - * @member {array} [values] - */ -export interface ErrorModel { - errorCode: string; - message: Message; - values?: Item[]; -} - -/** - * @class - * Initializes a new instance of the FailoverRequest class. - * @constructor - * The Failover request object. - * - * @member {array} [accesspointIds] - * @member {string} [targetDeviceId] - * @member {boolean} [skipValidation] - * @member {boolean} [keepSourceDevice] - */ -export interface FailoverRequest { - accesspointIds?: string[]; - targetDeviceId?: string; - skipValidation?: boolean; - keepSourceDevice?: boolean; -} - -/** - * @class - * Initializes a new instance of the FileServer class. - * @constructor - * The file server. - * - * @member {string} domainName Domain of the file server - * @member {string} storageDomainId The storage domain id. - * @member {string} backupScheduleGroupId The backup policy id. - * @member {string} [description] The description of the file server - */ -export interface FileServer extends BaseModel { - domainName: string; - storageDomainId: string; - backupScheduleGroupId: string; - description?: string; -} - -/** - * @class - * Initializes a new instance of the IPConfig class. - * @constructor - * Details related to the IP address configuration - * - * @member {string} ipAddress The ipaddress of the network adapter, either ipv4 - * or ipv6. - * @member {number} [prefixLength] The prefix length of the network adapter. - * @member {string} gateway The gateway of the network adapter. - */ -export interface IPConfig { - ipAddress: string; - prefixLength?: number; - gateway: string; -} - -/** - * @class - * Initializes a new instance of the ISCSIServer class. - * @constructor - * The iscsi server. - * - * @member {string} storageDomainId The storage domain id. - * @member {string} backupScheduleGroupId The backup policy id. - * @member {string} [description] The description. - * @member {string} [chapId] The chap id. - * @member {string} [reverseChapId] The reverse chap id. - */ -export interface ISCSIServer extends BaseModel { - storageDomainId: string; - backupScheduleGroupId: string; - description?: string; - chapId?: string; - reverseChapId?: string; -} - -/** - * @class - * Initializes a new instance of the JobErrorItem class. - * @constructor - * The job error items. - * - * @member {array} [recommendations] The recommended actions. - * @member {string} code The code intended for programmatic access - * @member {string} message The message intended to describe the error in - * detail - */ -export interface JobErrorItem { - recommendations?: string[]; - code: string; - message: string; -} - -/** - * @class - * Initializes a new instance of the JobErrorDetails class. - * @constructor - * The job error information containing List of JobErrorItem. - * - * @member {array} [errorDetails] The error details. - * @member {string} code The code intended for programmatic access - * @member {string} message The message intended to describe the error in - * detail - */ -export interface JobErrorDetails { - errorDetails?: JobErrorItem[]; - code: string; - message: string; -} - -/** - * @class - * Initializes a new instance of the JobStage class. - * @constructor - * Contains details about the multiple job stages of a job - * - * @member {string} [message] The message of the job stage. - * @member {string} stageStatus The stage status. Possible values include: - * 'Invalid', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Paused', - * 'Scheduled' - * @member {string} [detail] The details of the stage. - * @member {string} [errorCode] The error code of the stage if any. - */ -export interface JobStage { - message?: string; - stageStatus: string; - detail?: string; - errorCode?: string; -} - -/** - * @class - * Initializes a new instance of the JobStats class. - * @constructor - * Stats that are available for all jobs in common - * - * @member {number} [completedWorkItemCount] Completed work item count. - * @member {number} [totalWorkItemCount] Total work item count. - * @member {number} [estimatedTimeRemaining] The estimated time remaining. - */ -export interface JobStats { - completedWorkItemCount?: number; - totalWorkItemCount?: number; - estimatedTimeRemaining?: number; -} - -/** - * @class - * Initializes a new instance of the UpdateDownloadProgress class. - * @constructor - * details available during the download - * - * @member {string} [downloadPhase] The download phase. Possible values - * include: 'Unknown', 'Initializing', 'Downloading', 'Verifying' - * @member {number} [percentComplete] Percentage of completion. - * @member {number} [totalBytesToDownload] Total bytes to download. - * @member {number} [totalBytesDownloaded] Total bytes downloaded. - * @member {number} [numberOfUpdatesToDownload] Number of updates to download. - * @member {number} [numberOfUpdatesDownloaded] Number of updates downloaded. - */ -export interface UpdateDownloadProgress { - downloadPhase?: string; - percentComplete?: number; - totalBytesToDownload?: number; - totalBytesDownloaded?: number; - numberOfUpdatesToDownload?: number; - numberOfUpdatesDownloaded?: number; -} - -/** - * @class - * Initializes a new instance of the UpdateInstallProgress class. - * @constructor - * Class representing the progress during installation of updates - * - * @member {number} [percentComplete] Percentage of completion. - * @member {number} [numberOfUpdatesToInstall] Number of updates to install. - * @member {number} [numberOfUpdatesInstalled] Number of updates installed. - */ -export interface UpdateInstallProgress { - percentComplete?: number; - numberOfUpdatesToInstall?: number; - numberOfUpdatesInstalled?: number; -} - -/** - * @class - * Initializes a new instance of the Job class. - * @constructor - * The Job. - * - * @member {string} status Current status of the job. Possible values include: - * 'Invalid', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Paused', - * 'Scheduled' - * @member {date} [startTime] The UTC time at which the job was started - * @member {date} [endTime] The UTC time at which the job completed - * @member {number} percentComplete The percentage of the job that is already - * complete - * @member {object} [error] The Error details. - * @member {array} [error.errorDetails] The error details. - * @member {string} [error.code] The code intended for programmatic access - * @member {string} [error.message] The message intended to describe the error - * in detail - * @member {string} jobType Type of the job. Possible values include: 'Backup', - * 'Clone', 'Failover', 'DownloadUpdates', 'InstallUpdates' - * @member {string} [targetId] Id of the object that is created by the job - * @member {string} [entityId] The entity identifier for which the job ran. - * @member {string} [entityType] The entity type for which the job ran. - * @member {array} [jobStages] The job stages. - * @member {string} [deviceId] The device id in which the job is currently - * running - * @member {boolean} [isCancellable] Represents whether the job is cancellable - * or not - * @member {object} [stats] stats properties for the job - * @member {number} [stats.completedWorkItemCount] Completed work item count. - * @member {number} [stats.totalWorkItemCount] Total work item count. - * @member {number} [stats.estimatedTimeRemaining] The estimated time - * remaining. - * @member {string} [targetType] The target type of the backup. Possible values - * include: 'FileServer', 'DiskServer' - * @member {string} [sourceDeviceId] The source device identifier of the - * failover job. - * @member {date} [backupPointInTime] The time of the backup used for the - * failover. - * @member {object} [downloadProgress] The download progress. - * @member {string} [downloadProgress.downloadPhase] The download phase. - * Possible values include: 'Unknown', 'Initializing', 'Downloading', - * 'Verifying' - * @member {number} [downloadProgress.percentComplete] Percentage of - * completion. - * @member {number} [downloadProgress.totalBytesToDownload] Total bytes to - * download. - * @member {number} [downloadProgress.totalBytesDownloaded] Total bytes - * downloaded. - * @member {number} [downloadProgress.numberOfUpdatesToDownload] Number of - * updates to download. - * @member {number} [downloadProgress.numberOfUpdatesDownloaded] Number of - * updates downloaded. - * @member {object} [installProgress] The install progress. - * @member {number} [installProgress.percentComplete] Percentage of completion. - * @member {number} [installProgress.numberOfUpdatesToInstall] Number of - * updates to install. - * @member {number} [installProgress.numberOfUpdatesInstalled] Number of - * updates installed. - */ -export interface Job extends BaseModel { - status: string; - startTime?: Date; - endTime?: Date; - percentComplete: number; - error?: JobErrorDetails; - jobType: string; - targetId?: string; - entityId?: string; - entityType?: string; - jobStages?: JobStage[]; - deviceId?: string; - isCancellable?: boolean; - stats?: JobStats; - targetType?: string; - sourceDeviceId?: string; - backupPointInTime?: Date; - downloadProgress?: UpdateDownloadProgress; - installProgress?: UpdateInstallProgress; -} - -/** - * @class - * Initializes a new instance of the JobFilter class. - * @constructor - * Filters that can be specified for the job - * - * @member {string} jobType The job type. Possible values include: 'Backup', - * 'Clone', 'Failover', 'DownloadUpdates', 'InstallUpdates' - * @member {string} status The job status. Possible values include: 'Invalid', - * 'Running', 'Succeeded', 'Failed', 'Canceled', 'Paused', 'Scheduled' - * @member {date} [startTime] The start time of the job. - */ -export interface JobFilter { - jobType: string; - status: string; - startTime?: Date; -} - -/** - * @class - * Initializes a new instance of the ManagerIntrinsicSettings class. - * @constructor - * Intrinsic settings which refers to the type of the Storsimple manager - * - * @member {string} type Refers to the type of the StorSimple Manager. Possible - * values include: 'GardaV1', 'HelsinkiV1' - */ -export interface ManagerIntrinsicSettings { - type: string; -} - -/** - * @class - * Initializes a new instance of the ManagerSku class. - * @constructor - * The Sku. - * - */ -export interface ManagerSku { -} - -/** - * @class - * Initializes a new instance of the Resource class. - * @constructor - * The Azure Resource. - * - * @member {string} [id] The Resource Id - * @member {string} [name] The Resource Name - * @member {string} [type] The Resource type - * @member {string} location The Geo location of the Manager - * @member {object} [tags] Tags attached to the Manager - */ -export interface Resource extends BaseResource { - readonly id?: string; - readonly name?: string; - readonly type?: string; - location: string; - tags?: { [propertyName: string]: string }; -} - -/** - * @class - * Initializes a new instance of the Manager class. - * @constructor - * The StorSimple Manager - * - * @member {object} [cisIntrinsicSettings] Specifies if the Manager is Garda or - * Helsinki - * @member {string} [cisIntrinsicSettings.type] Refers to the type of the - * StorSimple Manager. Possible values include: 'GardaV1', 'HelsinkiV1' - * @member {string} [provisioningState] Specifies the state of the resource as - * it is getting provisioned. Value of "Succeeded" means the Manager was - * successfully created - * @member {string} [etag] ETag of the Manager - */ -export interface Manager extends Resource { - cisIntrinsicSettings?: ManagerIntrinsicSettings; - readonly provisioningState?: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the ManagerExtendedInfo class. - * @constructor - * The extended info of the manager. - * - * @member {string} [version] Represents the version of the ExtendedInfo object - * being persisted - * @member {string} integrityKey Represents the CIK of the resource - * @member {string} [encryptionKey] Represents the CEK of the resource - * @member {string} [encryptionKeyThumbprint] Represents the Cert thumbprint - * that was used to encrypt the CEK - * @member {string} [portalCertificateThumbprint] Represents the portal - * thumbprint which can be used optionally to encrypt the entire data before - * storing it. - * @member {string} algorithm Represents the encryption algorithm used to - * encrypt the other keys. None - if EncryptionKey is saved in plain text - * format. AlgorithmName - if encryption is used - * @member {string} [etag] ETag of the Resource - */ -export interface ManagerExtendedInfo extends BaseModel { - version?: string; - integrityKey: string; - encryptionKey?: string; - encryptionKeyThumbprint?: string; - portalCertificateThumbprint?: string; - algorithm: string; - etag?: string; -} - -/** - * @class - * Initializes a new instance of the ManagerPatch class. - * @constructor - * The StorSimple Manager patch. - * - * @member {object} [tags] The tags attached to the StorSimple Manager. - */ -export interface ManagerPatch { - tags?: { [propertyName: string]: string }; -} - -/** - * @class - * Initializes a new instance of the MetricAvailablity class. - * @constructor - * Metric availability specifies the time grain (aggregation interval or - * frequency) and the retention period for that time grain - * - * @member {string} timeGrain The time grain, specifies the aggregation - * interval for the metric. - * @member {string} retention The retention period for the metric at the - * specified timegrain - */ -export interface MetricAvailablity { - timeGrain: string; - retention: string; -} - -/** - * @class - * Initializes a new instance of the MetricData class. - * @constructor - * The metric data. - * - * @member {date} timeStamp The time when the metric data is fetched - * @member {number} sum The sum of all the samples available in the given - * instance of time for the specific metric data - * @member {number} count The count of samples of the metric data available for - * the given instance - * @member {number} average The average of all sample for the given instance - * @member {number} minimum The minimum of all samples available - * @member {number} maximum The maximum of all samples available - */ -export interface MetricData { - timeStamp: Date; - sum: number; - count: number; - average: number; - minimum: number; - maximum: number; -} - -/** - * @class - * Initializes a new instance of the MetricName class. - * @constructor - * The name of the metric - * - * @member {string} value Name of the metric - * @member {string} localizedValue Localized name of the metric - */ -export interface MetricName { - value: string; - localizedValue: string; -} - -/** - * @class - * Initializes a new instance of the MetricDimension class. - * @constructor - * Metric dimension - * - * @member {string} name Metric dimension name - * @member {string} value Metric dimension values - */ -export interface MetricDimension { - name: string; - value: string; -} - -/** - * @class - * Initializes a new instance of the MetricDefinition class. - * @constructor - * Monitoring metric definition represents the metadata of the metrics. - * - * @member {object} name The metric name - * @member {string} [name.value] Name of the metric - * @member {string} [name.localizedValue] Localized name of the metric - * @member {string} unit The metric unit. Possible values include: 'Bytes', - * 'BytesPerSecond', 'Count', 'CountPerSecond', 'Percent', 'Seconds' - * @member {string} primaryAggregationType The metric aggregation type. - * Possible values include: 'Average', 'Last', 'Maximum', 'Minimum', 'None', - * 'Total' - * @member {string} resourceId The metric source id - * @member {array} metricAvailabilities The available metric granularities - * @member {array} dimensions The supported dimensions - * @member {string} type The metric definition type - */ -export interface MetricDefinition { - name: MetricName; - unit: string; - primaryAggregationType: string; - resourceId: string; - metricAvailabilities: MetricAvailablity[]; - dimensions: MetricDimension[]; - type: string; -} - -/** - * @class - * Initializes a new instance of the MetricNameFilter class. - * @constructor - * Class representing the name filter to be passed while fetching metrics - * - * @member {string} [value] The value. - */ -export interface MetricNameFilter { - value?: string; -} - -/** - * @class - * Initializes a new instance of the MetricFilter class. - * @constructor - * class representing the filters to be passed while fetching metrics - * - * @member {object} [name] filter for name property - * @member {string} [name.value] The value. - * @member {date} [startTime] starttime for fetching metrics - * @member {date} [endTime] endtime for fetching metrics - * @member {string} [timeGrain] timegrain of the metrics - */ -export interface MetricFilter { - name?: MetricNameFilter; - startTime?: Date; - endTime?: Date; - timeGrain?: string; -} - -/** - * @class - * Initializes a new instance of the Metrics class. - * @constructor - * Monitoring metric - * - * @member {string} resourceId The id of metric source - * @member {date} startTime The metric start time - * @member {date} endTime The metric end time - * @member {string} timeGrain The time grain, time grain indicates frequency of - * the metric data - * @member {string} primaryAggregation The metric aggregation type. Possible - * values include: 'Average', 'Last', 'Maximum', 'Minimum', 'None', 'Total' - * @member {object} name The name of the metrics - * @member {string} [name.value] Name of the metric - * @member {string} [name.localizedValue] Localized name of the metric - * @member {array} dimensions The Metric dimension which indicates the source - * of the metric - * @member {string} unit The unit of the metric data. Possible values include: - * 'Bytes', 'BytesPerSecond', 'Count', 'CountPerSecond', 'Percent', 'Seconds' - * @member {string} type The Type of the metric data - * @member {array} values The metric data - */ -export interface Metrics { - resourceId: string; - startTime: Date; - endTime: Date; - timeGrain: string; - primaryAggregation: string; - name: MetricName; - dimensions: MetricDimension[]; - unit: string; - type: string; - values: MetricData[]; -} - -/** - * @class - * Initializes a new instance of the NetworkAdapter class. - * @constructor - * Represents a networkAdapter in a particular node. - * - * @member {string} networkAdapterName The name of the network adapter. - * @member {object} [iPv4Info] The ipv4 configuration of the network adapter. - * @member {string} [iPv4Info.ipAddress] The ipaddress of the network adapter, - * either ipv4 or ipv6. - * @member {number} [iPv4Info.prefixLength] The prefix length of the network - * adapter. - * @member {string} [iPv4Info.gateway] The gateway of the network adapter. - * @member {object} [iPv6Info] The ipv6 configuration of the network adapter. - * @member {string} [iPv6Info.ipAddress] The ipaddress of the network adapter, - * either ipv4 or ipv6. - * @member {number} [iPv6Info.prefixLength] The prefix length of the network - * adapter. - * @member {string} [iPv6Info.gateway] The gateway of the network adapter. - * @member {string} dhcpStatus Represents state of DHCP. Possible values - * include: 'Enabled', 'Disabled' - * @member {number} [linkSpeed] The speed of the network adapter. - */ -export interface NetworkAdapter { - networkAdapterName: string; - iPv4Info?: IPConfig; - iPv6Info?: IPConfig; - dhcpStatus: string; - linkSpeed?: number; -} - -/** - * @class - * Initializes a new instance of the NodeNetwork class. - * @constructor - * Represents a single node in a device. - * - * @member {array} networkAdapters The array of network adapters in the node. - */ -export interface NodeNetwork { - networkAdapters: NetworkAdapter[]; -} - -/** - * @class - * Initializes a new instance of the NetworkSettings class. - * @constructor - * The NetworkSettings of a device - * - * @member {string} primaryDnsServer The Primary DNS server for the device - * @member {string} [secondaryDnsServer] The secondary DNS server for the - * device - * @member {array} nodeNetworks The NetworkAdapters under each node of the - * device. - */ -export interface NetworkSettings extends BaseModel { - primaryDnsServer: string; - secondaryDnsServer?: string; - nodeNetworks: NodeNetwork[]; -} - -/** - * @class - * Initializes a new instance of the SecuritySettings class. - * @constructor - * The SecuritySettings of a device - * - * @member {object} deviceAdminPassword Device administrator password as an - * encrypted string (encrypted using RSA PKCS #1) is used to log into the - * local web UI of the device. Actual password could have at least 8 characters - * that are a combination of uppercase, lowercase, numeric, and special - * characters - * @member {string} [deviceAdminPassword.value] The value of the secret itself. - * If the secret is in plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. - * @member {string} [deviceAdminPassword.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * @member {string} [deviceAdminPassword.encryptionAlgorithm] Algorithm used to - * encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - */ -export interface SecuritySettings extends BaseModel { - deviceAdminPassword: AsymmetricEncryptedSecret; -} - -/** - * @class - * Initializes a new instance of the SendTestAlertEmailRequest class. - * @constructor - * Request for sending test alert email - * - * @member {array} emailList List of emails to send the test alerts - */ -export interface SendTestAlertEmailRequest { - emailList: string[]; -} - -/** - * @class - * Initializes a new instance of the StorageAccountCredential class. - * @constructor - * The storage account credential - * - * @member {string} cloudType The cloud service provider. Possible values - * include: 'Azure', 'S3', 'S3_RRS', 'OpenStack', 'HP' - * @member {string} endPoint The storage endpoint - * @member {string} login The storage account login - * @member {string} [location] The storage account's geo location - * @member {string} enableSSL SSL needs to be enabled or not. Possible values - * include: 'Enabled', 'Disabled' - * @member {object} [accessKey] The details of the storage account password - * @member {string} [accessKey.value] The value of the secret itself. If the - * secret is in plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. - * @member {string} [accessKey.encryptionCertificateThumbprint] Thumbprint - * certificate that was used to encrypt "Value" - * @member {string} [accessKey.encryptionAlgorithm] Algorithm used to encrypt - * "Value". Possible values include: 'None', 'AES256', 'RSAES_PKCS1_v_1_5' - */ -export interface StorageAccountCredential extends BaseModel { - cloudType: string; - endPoint: string; - login: string; - location?: string; - enableSSL: string; - accessKey?: AsymmetricEncryptedSecret; -} - -/** - * @class - * Initializes a new instance of the StorageDomain class. - * @constructor - * The storage domain. - * - * @member {array} storageAccountCredentialIds The storage account credentials. - * @member {object} [encryptionKey] The encryption key used to encrypt the - * data. This is a user secret. - * @member {string} [encryptionKey.value] The value of the secret itself. If - * the secret is in plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. - * @member {string} [encryptionKey.encryptionCertificateThumbprint] Thumbprint - * certificate that was used to encrypt "Value" - * @member {string} [encryptionKey.encryptionAlgorithm] Algorithm used to - * encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * @member {string} encryptionStatus The encryption status "Enabled | - * Disabled". Possible values include: 'Enabled', 'Disabled' - */ -export interface StorageDomain extends BaseModel { - storageAccountCredentialIds: string[]; - encryptionKey?: AsymmetricEncryptedSecret; - encryptionStatus: string; -} - -/** - * @class - * Initializes a new instance of the SymmetricEncryptedSecret class. - * @constructor - * This class can be used as the Type for any secret entity represented as - * Value, ValueCertificateThumbprint, EncryptionAlgorithm. In this case, - * "Value" is a secret and the "valueThumbprint" represents the certificate - * thumbprint of the value. The algorithm field is mainly for future usage to - * potentially allow different entities encrypted using different algorithms. - * - * @member {string} value The value of the secret itself. If the secret is in - * plaintext or null then EncryptionAlgorithm will be none - * @member {string} [valueCertificateThumbprint] Thumbprint cert that was used - * to encrypt "Value" - * @member {string} encryptionAlgorithm Algorithm used to encrypt "Value". - * Possible values include: 'None', 'AES256', 'RSAES_PKCS1_v_1_5' - */ -export interface SymmetricEncryptedSecret { - value: string; - valueCertificateThumbprint?: string; - encryptionAlgorithm: string; -} - -/** - * @class - * Initializes a new instance of the TimeSettings class. - * @constructor - * The TimeSettings of a device - * - * @member {string} timeZone The timezone of device, like '(UTC -06:00) Central - * America' - * @member {string} primaryTimeServer The primary Network Time Protocol (NTP) - * server name, like 'time.windows.com'. - * @member {string} [secondaryTimeServer] The secondary Network Time Protocol - * (NTP) server name, like 'time.contoso.com'. It's optional. - */ -export interface TimeSettings extends BaseModel { - timeZone: string; - primaryTimeServer: string; - secondaryTimeServer?: string; -} - -/** - * @class - * Initializes a new instance of the Updates class. - * @constructor - * The updates profile - * - * @member {string} [deviceVersion] The current Device version. - * @member {date} [deviceLastScannedTime] The last time when the device did an - * update scan. - * @member {boolean} [regularUpdatesAvailable] Set to true if regular updates - * were detected for the current version of the device. - * @member {boolean} [rebootRequiredForInstall] Set to true if - * RegularUpdatesAvailable is true and if atleast one of the updateItems - * detected has needs a reboot to install. - * @member {number} [totalItemsPendingForDownload] The total number of items - * pending for download. - * @member {number} [totalItemsPendingForInstall] The total number of items - * pending for install. - * @member {string} [status] The current update operation. Possible values - * include: 'Idle', 'Scanning', 'Downloading', 'Installing' - * @member {date} [lastCompletedScanTime] The time when the last scan job was - * completed (success|cancelled|failed) on the device. - * @member {date} [lastCompletedDownloadJobTime] The time when the last - * Download job was completed (success|cancelled|failed) on the device. - * @member {date} [lastCompletedInstallJobTime] The time when the last Install - * job was completed (success|cancelled|failed) on the device. - * @member {string} [inProgressDownloadJobId] If a download is in progress, - * this field contains the JobId of that particular download job - * @member {string} [inProgressInstallJobId] If an install is in progress, this - * field contains the JobId of that particular install job - * @member {date} [inProgressScanStartedTime] The time when the currently - * running scan (if any) started - * @member {date} [inProgressDownloadJobStartedTime] The time when the - * currently running download (if any) started - * @member {date} [inProgressInstallJobStartedTime] The time when the currently - * running install (if any) started - */ -export interface Updates extends BaseModel { - deviceVersion?: string; - deviceLastScannedTime?: Date; - regularUpdatesAvailable?: boolean; - rebootRequiredForInstall?: boolean; - totalItemsPendingForDownload?: number; - totalItemsPendingForInstall?: number; - status?: string; - lastCompletedScanTime?: Date; - lastCompletedDownloadJobTime?: Date; - lastCompletedInstallJobTime?: Date; - inProgressDownloadJobId?: string; - inProgressInstallJobId?: string; - inProgressScanStartedTime?: Date; - inProgressDownloadJobStartedTime?: Date; - inProgressInstallJobStartedTime?: Date; -} - -/** - * @class - * Initializes a new instance of the UploadCertificateRequest class. - * @constructor - * Upload Certificate Request to IDM - * - * @member {string} [authType] Specify the Authentication type. Possible values - * include: 'Invalid', 'AccessControlService', 'AzureActiveDirectory' - * @member {string} certificate Gets or sets the base64 encoded certificate raw - * data string - * @member {string} [contractVersion] Gets ContractVersion. Possible values - * include: 'InvalidVersion', 'V2011_09', 'V2012_02', 'V2012_05', 'V2012_12', - * 'V2013_04', 'V2013_10', 'V2013_11', 'V2014_04', 'V2014_06', 'V2014_07', - * 'V2014_09', 'V2014_10', 'V2014_12', 'V2015_01', 'V2015_02', 'V2015_04', - * 'V2015_05', 'V2015_06', 'V2015_07', 'V2015_08', 'V2015_10', 'V2015_12', - * 'V2016_01', 'V2016_02', 'V2016_04', 'V2016_05', 'V2016_07', 'V2016_08' - */ -export interface UploadCertificateRequest { - authType?: string; - certificate: string; - readonly contractVersion?: string; -} - -/** - * @class - * Initializes a new instance of the UploadCertificateResponse class. - * @constructor - * Upload Certificate Response from IDM - * - * @member {string} [authType] Specify the Authentication type. Possible values - * include: 'Invalid', 'AccessControlService', 'AzureActiveDirectory' - * @member {string} certificate Gets or sets the base64 encoded certificate raw - * data string - * @member {number} resourceId Gets or Sets the ResourceId - * @member {string} aadAuthority AAD tenant authority - * @member {string} aadTenantId AAD tenant Id - * @member {string} servicePrincipalClientId AAD service principal clientId - * @member {string} servicePrincipalObjectId AAD service principal ObjectId - * @member {string} azureManagementEndpointAudience Azure Management Endpoint - * Audience - * @member {string} subject Certificate Subject Name - * @member {date} validFrom Certificate Validity start Date time - * @member {date} validTo Certificate Validity End Date time - * @member {string} thumbprint Certificate thumbrprint - * @member {string} friendlyName Certificate friendlyname - * @member {string} issuer Certificate issuer - */ -export interface UploadCertificateResponse extends BaseModel { - authType?: string; - certificate: string; - resourceId: number; - aadAuthority: string; - aadTenantId: string; - servicePrincipalClientId: string; - servicePrincipalObjectId: string; - azureManagementEndpointAudience: string; - subject: string; - validFrom: Date; - validTo: Date; - thumbprint: string; - friendlyName: string; - issuer: string; -} - - -/** - * @class - * Initializes a new instance of the ManagerList class. - * @constructor - * List of storsimple Managers under a particular resourceGroup - * - */ -export interface ManagerList extends Array { -} - -/** - * @class - * Initializes a new instance of the MetricList class. - * @constructor - * Collection of metrics - * - */ -export interface MetricList extends Array { -} - -/** - * @class - * Initializes a new instance of the MetricDefinitionList class. - * @constructor - * List of metric definition - * - */ -export interface MetricDefinitionList extends Array { -} - -/** - * @class - * Initializes a new instance of the AvailableProviderOperations class. - * @constructor - * Class for set of operations used for discovery of available provider - * operations. - * - * @member {string} [nextLink] The NextLink. - */ -export interface AvailableProviderOperations extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the AccessControlRecordList class. - * @constructor - * Collection of AccessControlRecords - * - */ -export interface AccessControlRecordList extends Array { -} - -/** - * @class - * Initializes a new instance of the AlertList class. - * @constructor - * Collection of Alerts - * - * @member {string} [nextLink] Id of the next page of alerts - */ -export interface AlertList extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the BackupList class. - * @constructor - * Collection of backups - * - * @member {string} [nextLink] The NextLink. - */ -export interface BackupList extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the DeviceList class. - * @constructor - * Collection of Devices - * - */ -export interface DeviceList extends Array { -} - -/** - * @class - * Initializes a new instance of the BackupScheduleGroupList class. - * @constructor - * The list response of backup schedule groups - * - */ -export interface BackupScheduleGroupList extends Array { -} - -/** - * @class - * Initializes a new instance of the ChapSettingsList class. - * @constructor - * Collection of Chap setting entities - * - */ -export interface ChapSettingsList extends Array { -} - -/** - * @class - * Initializes a new instance of the ISCSIDiskList class. - * @constructor - * Collection of Iscsi disk - * - */ -export interface ISCSIDiskList extends Array { -} - -/** - * @class - * Initializes a new instance of the FileServerList class. - * @constructor - * Collection of file servers - * - */ -export interface FileServerList extends Array { -} - -/** - * @class - * Initializes a new instance of the FileShareList class. - * @constructor - * Collection of file shares - * - */ -export interface FileShareList extends Array { -} - -/** - * @class - * Initializes a new instance of the ISCSIServerList class. - * @constructor - * Collection of Iscsi servers - * - */ -export interface ISCSIServerList extends Array { -} - -/** - * @class - * Initializes a new instance of the JobList class. - * @constructor - * Collection of jobs - * - * @member {string} [nextLink] The NextLink. - */ -export interface JobList extends Array { - nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the StorageAccountCredentialList class. - * @constructor - * Collection of Storage account credential entities - * - */ -export interface StorageAccountCredentialList extends Array { -} - -/** - * @class - * Initializes a new instance of the StorageDomainList class. - * @constructor - * Collection of storage domains - * - */ -export interface StorageDomainList extends Array { -} diff --git a/lib/services/storSimple1200Series/lib/models/index.js b/lib/services/storSimple1200Series/lib/models/index.js deleted file mode 100644 index 3a9b68c7d4..0000000000 --- a/lib/services/storSimple1200Series/lib/models/index.js +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -/* jshint latedef:false */ -/* jshint forin:false */ -/* jshint noempty:false */ - -'use strict'; - -var msRestAzure = require('ms-rest-azure'); - -exports.BaseResource = msRestAzure.BaseResource; -exports.CloudError = msRestAzure.CloudError; -exports.BaseModel = require('./baseModel'); -exports.AccessControlRecord = require('./accessControlRecord'); -exports.AlertSource = require('./alertSource'); -exports.AlertErrorDetails = require('./alertErrorDetails'); -exports.Alert = require('./alert'); -exports.AlertFilter = require('./alertFilter'); -exports.AlertSettings = require('./alertSettings'); -exports.AsymmetricEncryptedSecret = require('./asymmetricEncryptedSecret'); -exports.AvailableProviderOperationDisplay = require('./availableProviderOperationDisplay'); -exports.AvailableProviderOperation = require('./availableProviderOperation'); -exports.BackupElement = require('./backupElement'); -exports.Backup = require('./backup'); -exports.BackupFilter = require('./backupFilter'); -exports.Time = require('./time'); -exports.BackupScheduleGroup = require('./backupScheduleGroup'); -exports.ChapSettings = require('./chapSettings'); -exports.ClearAlertRequest = require('./clearAlertRequest'); -exports.FileShare = require('./fileShare'); -exports.ISCSIDisk = require('./iSCSIDisk'); -exports.CloneRequest = require('./cloneRequest'); -exports.DeviceDetails = require('./deviceDetails'); -exports.Device = require('./device'); -exports.DevicePatch = require('./devicePatch'); -exports.EncryptionSettings = require('./encryptionSettings'); -exports.Message = require('./message'); -exports.Item = require('./item'); -exports.ErrorModel = require('./errorModel'); -exports.FailoverRequest = require('./failoverRequest'); -exports.FileServer = require('./fileServer'); -exports.IPConfig = require('./iPConfig'); -exports.ISCSIServer = require('./iSCSIServer'); -exports.JobErrorItem = require('./jobErrorItem'); -exports.JobErrorDetails = require('./jobErrorDetails'); -exports.JobStage = require('./jobStage'); -exports.JobStats = require('./jobStats'); -exports.UpdateDownloadProgress = require('./updateDownloadProgress'); -exports.UpdateInstallProgress = require('./updateInstallProgress'); -exports.Job = require('./job'); -exports.JobFilter = require('./jobFilter'); -exports.ManagerIntrinsicSettings = require('./managerIntrinsicSettings'); -exports.ManagerSku = require('./managerSku'); -exports.Resource = require('./resource'); -exports.Manager = require('./manager'); -exports.ManagerExtendedInfo = require('./managerExtendedInfo'); -exports.ManagerPatch = require('./managerPatch'); -exports.MetricAvailablity = require('./metricAvailablity'); -exports.MetricData = require('./metricData'); -exports.MetricName = require('./metricName'); -exports.MetricDimension = require('./metricDimension'); -exports.MetricDefinition = require('./metricDefinition'); -exports.MetricNameFilter = require('./metricNameFilter'); -exports.MetricFilter = require('./metricFilter'); -exports.Metrics = require('./metrics'); -exports.NetworkAdapter = require('./networkAdapter'); -exports.NodeNetwork = require('./nodeNetwork'); -exports.NetworkSettings = require('./networkSettings'); -exports.SecuritySettings = require('./securitySettings'); -exports.SendTestAlertEmailRequest = require('./sendTestAlertEmailRequest'); -exports.StorageAccountCredential = require('./storageAccountCredential'); -exports.StorageDomain = require('./storageDomain'); -exports.SymmetricEncryptedSecret = require('./symmetricEncryptedSecret'); -exports.TimeSettings = require('./timeSettings'); -exports.Updates = require('./updates'); -exports.UploadCertificateRequest = require('./uploadCertificateRequest'); -exports.UploadCertificateResponse = require('./uploadCertificateResponse'); -exports.ManagerList = require('./managerList'); -exports.MetricList = require('./metricList'); -exports.MetricDefinitionList = require('./metricDefinitionList'); -exports.AvailableProviderOperations = require('./availableProviderOperations'); -exports.AccessControlRecordList = require('./accessControlRecordList'); -exports.AlertList = require('./alertList'); -exports.BackupList = require('./backupList'); -exports.DeviceList = require('./deviceList'); -exports.BackupScheduleGroupList = require('./backupScheduleGroupList'); -exports.ChapSettingsList = require('./chapSettingsList'); -exports.ISCSIDiskList = require('./iSCSIDiskList'); -exports.FileServerList = require('./fileServerList'); -exports.FileShareList = require('./fileShareList'); -exports.ISCSIServerList = require('./iSCSIServerList'); -exports.JobList = require('./jobList'); -exports.StorageAccountCredentialList = require('./storageAccountCredentialList'); -exports.StorageDomainList = require('./storageDomainList'); diff --git a/lib/services/storSimple1200Series/lib/models/item.js b/lib/services/storSimple1200Series/lib/models/item.js deleted file mode 100644 index c97cfb1bc5..0000000000 --- a/lib/services/storSimple1200Series/lib/models/item.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Class representing a Item. - */ -class Item { - /** - * Create a Item. - * @member {string} key - * @member {string} value - */ - constructor() { - } - - /** - * Defines the metadata of Item - * - * @returns {object} metadata of Item - * - */ - mapper() { - return { - required: false, - serializedName: 'Item', - type: { - name: 'Composite', - className: 'Item', - modelProperties: { - key: { - required: true, - serializedName: 'key', - type: { - name: 'String' - } - }, - value: { - required: true, - serializedName: 'value', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = Item; diff --git a/lib/services/storSimple1200Series/lib/models/job.js b/lib/services/storSimple1200Series/lib/models/job.js deleted file mode 100644 index b9d7dad2b6..0000000000 --- a/lib/services/storSimple1200Series/lib/models/job.js +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The Job. - * - * @extends models['BaseModel'] - */ -class Job extends models['BaseModel'] { - /** - * Create a Job. - * @member {string} status Current status of the job. Possible values - * include: 'Invalid', 'Running', 'Succeeded', 'Failed', 'Canceled', - * 'Paused', 'Scheduled' - * @member {date} [startTime] The UTC time at which the job was started - * @member {date} [endTime] The UTC time at which the job completed - * @member {number} percentComplete The percentage of the job that is already - * complete - * @member {object} [error] The Error details. - * @member {array} [error.errorDetails] The error details. - * @member {string} [error.code] The code intended for programmatic access - * @member {string} [error.message] The message intended to describe the - * error in detail - * @member {string} jobType Type of the job. Possible values include: - * 'Backup', 'Clone', 'Failover', 'DownloadUpdates', 'InstallUpdates' - * @member {string} [targetId] Id of the object that is created by the job - * @member {string} [entityId] The entity identifier for which the job ran. - * @member {string} [entityType] The entity type for which the job ran. - * @member {array} [jobStages] The job stages. - * @member {string} [deviceId] The device id in which the job is currently - * running - * @member {boolean} [isCancellable] Represents whether the job is - * cancellable or not - * @member {object} [stats] stats properties for the job - * @member {number} [stats.completedWorkItemCount] Completed work item count. - * @member {number} [stats.totalWorkItemCount] Total work item count. - * @member {number} [stats.estimatedTimeRemaining] The estimated time - * remaining. - * @member {string} [targetType] The target type of the backup. Possible - * values include: 'FileServer', 'DiskServer' - * @member {string} [sourceDeviceId] The source device identifier of the - * failover job. - * @member {date} [backupPointInTime] The time of the backup used for the - * failover. - * @member {object} [downloadProgress] The download progress. - * @member {string} [downloadProgress.downloadPhase] The download phase. - * Possible values include: 'Unknown', 'Initializing', 'Downloading', - * 'Verifying' - * @member {number} [downloadProgress.percentComplete] Percentage of - * completion. - * @member {number} [downloadProgress.totalBytesToDownload] Total bytes to - * download. - * @member {number} [downloadProgress.totalBytesDownloaded] Total bytes - * downloaded. - * @member {number} [downloadProgress.numberOfUpdatesToDownload] Number of - * updates to download. - * @member {number} [downloadProgress.numberOfUpdatesDownloaded] Number of - * updates downloaded. - * @member {object} [installProgress] The install progress. - * @member {number} [installProgress.percentComplete] Percentage of - * completion. - * @member {number} [installProgress.numberOfUpdatesToInstall] Number of - * updates to install. - * @member {number} [installProgress.numberOfUpdatesInstalled] Number of - * updates installed. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of Job - * - * @returns {object} metadata of Job - * - */ - mapper() { - return { - required: false, - serializedName: 'Job', - type: { - name: 'Composite', - className: 'Job', - 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' - } - }, - status: { - required: true, - serializedName: 'status', - type: { - name: 'Enum', - allowedValues: [ 'Invalid', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Paused', 'Scheduled' ] - } - }, - startTime: { - required: false, - serializedName: 'startTime', - type: { - name: 'DateTime' - } - }, - endTime: { - required: false, - serializedName: 'endTime', - type: { - name: 'DateTime' - } - }, - percentComplete: { - required: true, - serializedName: 'percentComplete', - type: { - name: 'Number' - } - }, - error: { - required: false, - serializedName: 'error', - type: { - name: 'Composite', - className: 'JobErrorDetails' - } - }, - jobType: { - required: true, - serializedName: 'properties.jobType', - type: { - name: 'Enum', - allowedValues: [ 'Backup', 'Clone', 'Failover', 'DownloadUpdates', 'InstallUpdates' ] - } - }, - targetId: { - required: false, - serializedName: 'properties.targetId', - type: { - name: 'String' - } - }, - entityId: { - required: false, - serializedName: 'properties.entityId', - type: { - name: 'String' - } - }, - entityType: { - required: false, - serializedName: 'properties.entityType', - type: { - name: 'String' - } - }, - jobStages: { - required: false, - serializedName: 'properties.jobStages', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'JobStageElementType', - type: { - name: 'Composite', - className: 'JobStage' - } - } - } - }, - deviceId: { - required: false, - serializedName: 'properties.deviceId', - type: { - name: 'String' - } - }, - isCancellable: { - required: false, - serializedName: 'properties.isCancellable', - type: { - name: 'Boolean' - } - }, - stats: { - required: false, - serializedName: 'properties.stats', - type: { - name: 'Composite', - className: 'JobStats' - } - }, - targetType: { - required: false, - serializedName: 'properties.targetType', - type: { - name: 'Enum', - allowedValues: [ 'FileServer', 'DiskServer' ] - } - }, - sourceDeviceId: { - required: false, - serializedName: 'properties.sourceDeviceId', - type: { - name: 'String' - } - }, - backupPointInTime: { - required: false, - serializedName: 'properties.backupPointInTime', - type: { - name: 'DateTime' - } - }, - downloadProgress: { - required: false, - serializedName: 'properties.downloadProgress', - type: { - name: 'Composite', - className: 'UpdateDownloadProgress' - } - }, - installProgress: { - required: false, - serializedName: 'properties.installProgress', - type: { - name: 'Composite', - className: 'UpdateInstallProgress' - } - } - } - } - }; - } -} - -module.exports = Job; diff --git a/lib/services/storSimple1200Series/lib/models/jobErrorDetails.js b/lib/services/storSimple1200Series/lib/models/jobErrorDetails.js deleted file mode 100644 index bdee17613e..0000000000 --- a/lib/services/storSimple1200Series/lib/models/jobErrorDetails.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * The job error information containing List of JobErrorItem. - * - */ -class JobErrorDetails { - /** - * Create a JobErrorDetails. - * @member {array} [errorDetails] The error details. - * @member {string} code The code intended for programmatic access - * @member {string} message The message intended to describe the error in - * detail - */ - constructor() { - } - - /** - * Defines the metadata of JobErrorDetails - * - * @returns {object} metadata of JobErrorDetails - * - */ - mapper() { - return { - required: false, - serializedName: 'JobErrorDetails', - type: { - name: 'Composite', - className: 'JobErrorDetails', - modelProperties: { - errorDetails: { - required: false, - serializedName: 'errorDetails', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'JobErrorItemElementType', - type: { - name: 'Composite', - className: 'JobErrorItem' - } - } - } - }, - code: { - required: true, - serializedName: 'code', - type: { - name: 'String' - } - }, - message: { - required: true, - serializedName: 'message', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = JobErrorDetails; diff --git a/lib/services/storSimple1200Series/lib/models/jobErrorItem.js b/lib/services/storSimple1200Series/lib/models/jobErrorItem.js deleted file mode 100644 index 5564b5dba9..0000000000 --- a/lib/services/storSimple1200Series/lib/models/jobErrorItem.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * The job error items. - * - */ -class JobErrorItem { - /** - * Create a JobErrorItem. - * @member {array} [recommendations] The recommended actions. - * @member {string} code The code intended for programmatic access - * @member {string} message The message intended to describe the error in - * detail - */ - constructor() { - } - - /** - * Defines the metadata of JobErrorItem - * - * @returns {object} metadata of JobErrorItem - * - */ - mapper() { - return { - required: false, - serializedName: 'JobErrorItem', - type: { - name: 'Composite', - className: 'JobErrorItem', - modelProperties: { - recommendations: { - required: false, - serializedName: 'recommendations', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - code: { - required: true, - serializedName: 'code', - type: { - name: 'String' - } - }, - message: { - required: true, - serializedName: 'message', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = JobErrorItem; diff --git a/lib/services/storSimple1200Series/lib/models/jobFilter.js b/lib/services/storSimple1200Series/lib/models/jobFilter.js deleted file mode 100644 index 40b7cfe2ab..0000000000 --- a/lib/services/storSimple1200Series/lib/models/jobFilter.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Filters that can be specified for the job - * - */ -class JobFilter { - /** - * Create a JobFilter. - * @member {string} jobType The job type. Possible values include: 'Backup', - * 'Clone', 'Failover', 'DownloadUpdates', 'InstallUpdates' - * @member {string} status The job status. Possible values include: - * 'Invalid', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Paused', - * 'Scheduled' - * @member {date} [startTime] The start time of the job. - */ - constructor() { - } - - /** - * Defines the metadata of JobFilter - * - * @returns {object} metadata of JobFilter - * - */ - mapper() { - return { - required: false, - serializedName: 'JobFilter', - type: { - name: 'Composite', - className: 'JobFilter', - modelProperties: { - jobType: { - required: true, - serializedName: 'jobType', - type: { - name: 'Enum', - allowedValues: [ 'Backup', 'Clone', 'Failover', 'DownloadUpdates', 'InstallUpdates' ] - } - }, - status: { - required: true, - serializedName: 'status', - type: { - name: 'Enum', - allowedValues: [ 'Invalid', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Paused', 'Scheduled' ] - } - }, - startTime: { - required: false, - serializedName: 'startTime', - type: { - name: 'DateTime' - } - } - } - } - }; - } -} - -module.exports = JobFilter; diff --git a/lib/services/storSimple1200Series/lib/models/jobList.js b/lib/services/storSimple1200Series/lib/models/jobList.js deleted file mode 100644 index 8ca5b9c8d7..0000000000 --- a/lib/services/storSimple1200Series/lib/models/jobList.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Collection of jobs - */ -class JobList extends Array { - /** - * Create a JobList. - * @member {string} [nextLink] The NextLink. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of JobList - * - * @returns {object} metadata of JobList - * - */ - mapper() { - return { - required: false, - serializedName: 'JobList', - type: { - name: 'Composite', - className: 'JobList', - modelProperties: { - value: { - required: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'JobElementType', - type: { - name: 'Composite', - className: 'Job' - } - } - } - }, - nextLink: { - required: false, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = JobList; diff --git a/lib/services/storSimple1200Series/lib/models/jobStage.js b/lib/services/storSimple1200Series/lib/models/jobStage.js deleted file mode 100644 index 89bc59a92c..0000000000 --- a/lib/services/storSimple1200Series/lib/models/jobStage.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Contains details about the multiple job stages of a job - * - */ -class JobStage { - /** - * Create a JobStage. - * @member {string} [message] The message of the job stage. - * @member {string} stageStatus The stage status. Possible values include: - * 'Invalid', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Paused', - * 'Scheduled' - * @member {string} [detail] The details of the stage. - * @member {string} [errorCode] The error code of the stage if any. - */ - constructor() { - } - - /** - * Defines the metadata of JobStage - * - * @returns {object} metadata of JobStage - * - */ - mapper() { - return { - required: false, - serializedName: 'JobStage', - type: { - name: 'Composite', - className: 'JobStage', - modelProperties: { - message: { - required: false, - serializedName: 'message', - type: { - name: 'String' - } - }, - stageStatus: { - required: true, - serializedName: 'stageStatus', - type: { - name: 'Enum', - allowedValues: [ 'Invalid', 'Running', 'Succeeded', 'Failed', 'Canceled', 'Paused', 'Scheduled' ] - } - }, - detail: { - required: false, - serializedName: 'detail', - type: { - name: 'String' - } - }, - errorCode: { - required: false, - serializedName: 'errorCode', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = JobStage; diff --git a/lib/services/storSimple1200Series/lib/models/jobStats.js b/lib/services/storSimple1200Series/lib/models/jobStats.js deleted file mode 100644 index 8aafb9ce70..0000000000 --- a/lib/services/storSimple1200Series/lib/models/jobStats.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Stats that are available for all jobs in common - * - */ -class JobStats { - /** - * Create a JobStats. - * @member {number} [completedWorkItemCount] Completed work item count. - * @member {number} [totalWorkItemCount] Total work item count. - * @member {number} [estimatedTimeRemaining] The estimated time remaining. - */ - constructor() { - } - - /** - * Defines the metadata of JobStats - * - * @returns {object} metadata of JobStats - * - */ - mapper() { - return { - required: false, - serializedName: 'JobStats', - type: { - name: 'Composite', - className: 'JobStats', - modelProperties: { - completedWorkItemCount: { - required: false, - serializedName: 'completedWorkItemCount', - type: { - name: 'Number' - } - }, - totalWorkItemCount: { - required: false, - serializedName: 'totalWorkItemCount', - type: { - name: 'Number' - } - }, - estimatedTimeRemaining: { - required: false, - serializedName: 'estimatedTimeRemaining', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = JobStats; diff --git a/lib/services/storSimple1200Series/lib/models/manager.js b/lib/services/storSimple1200Series/lib/models/manager.js deleted file mode 100644 index fc823c3c7b..0000000000 --- a/lib/services/storSimple1200Series/lib/models/manager.js +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The StorSimple Manager - * - * @extends models['Resource'] - */ -class Manager extends models['Resource'] { - /** - * Create a Manager. - * @member {object} [cisIntrinsicSettings] Specifies if the Manager is Garda - * or Helsinki - * @member {string} [cisIntrinsicSettings.type] Refers to the type of the - * StorSimple Manager. Possible values include: 'GardaV1', 'HelsinkiV1' - * @member {string} [provisioningState] Specifies the state of the resource - * as it is getting provisioned. Value of "Succeeded" means the Manager was - * successfully created - * @member {string} [etag] ETag of the Manager - */ - constructor() { - super(); - } - - /** - * Defines the metadata of Manager - * - * @returns {object} metadata of Manager - * - */ - mapper() { - return { - required: false, - serializedName: 'Manager', - type: { - name: 'Composite', - className: 'Manager', - 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' - } - } - } - }, - cisIntrinsicSettings: { - required: false, - serializedName: 'properties.cisIntrinsicSettings', - type: { - name: 'Composite', - className: 'ManagerIntrinsicSettings' - } - }, - sku: { - required: false, - isConstant: true, - serializedName: 'properties.sku', - defaultValue: {}, - type: { - name: 'Composite', - className: 'ManagerSku' - } - }, - provisioningState: { - required: false, - readOnly: true, - serializedName: 'properties.provisioningState', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = Manager; diff --git a/lib/services/storSimple1200Series/lib/models/managerExtendedInfo.js b/lib/services/storSimple1200Series/lib/models/managerExtendedInfo.js deleted file mode 100644 index 26a6467771..0000000000 --- a/lib/services/storSimple1200Series/lib/models/managerExtendedInfo.js +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The extended info of the manager. - * - * @extends models['BaseModel'] - */ -class ManagerExtendedInfo extends models['BaseModel'] { - /** - * Create a ManagerExtendedInfo. - * @member {string} [version] Represents the version of the ExtendedInfo - * object being persisted - * @member {string} integrityKey Represents the CIK of the resource - * @member {string} [encryptionKey] Represents the CEK of the resource - * @member {string} [encryptionKeyThumbprint] Represents the Cert thumbprint - * that was used to encrypt the CEK - * @member {string} [portalCertificateThumbprint] Represents the portal - * thumbprint which can be used optionally to encrypt the entire data before - * storing it. - * @member {string} algorithm Represents the encryption algorithm used to - * encrypt the other keys. None - if EncryptionKey is saved in plain text - * format. AlgorithmName - if encryption is used - * @member {string} [etag] ETag of the Resource - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ManagerExtendedInfo - * - * @returns {object} metadata of ManagerExtendedInfo - * - */ - mapper() { - return { - required: false, - serializedName: 'ManagerExtendedInfo', - type: { - name: 'Composite', - className: 'ManagerExtendedInfo', - 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' - } - }, - version: { - required: false, - serializedName: 'properties.version', - type: { - name: 'String' - } - }, - integrityKey: { - required: true, - serializedName: 'properties.integrityKey', - type: { - name: 'String' - } - }, - encryptionKey: { - required: false, - serializedName: 'properties.encryptionKey', - type: { - name: 'String' - } - }, - encryptionKeyThumbprint: { - required: false, - serializedName: 'properties.encryptionKeyThumbprint', - type: { - name: 'String' - } - }, - portalCertificateThumbprint: { - required: false, - serializedName: 'properties.portalCertificateThumbprint', - type: { - name: 'String' - } - }, - algorithm: { - required: true, - serializedName: 'properties.algorithm', - type: { - name: 'String' - } - }, - etag: { - required: false, - serializedName: 'etag', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ManagerExtendedInfo; diff --git a/lib/services/storSimple1200Series/lib/models/managerIntrinsicSettings.js b/lib/services/storSimple1200Series/lib/models/managerIntrinsicSettings.js deleted file mode 100644 index e89a408604..0000000000 --- a/lib/services/storSimple1200Series/lib/models/managerIntrinsicSettings.js +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Intrinsic settings which refers to the type of the Storsimple manager - * - */ -class ManagerIntrinsicSettings { - /** - * Create a ManagerIntrinsicSettings. - * @member {string} type Refers to the type of the StorSimple Manager. - * Possible values include: 'GardaV1', 'HelsinkiV1' - */ - constructor() { - } - - /** - * Defines the metadata of ManagerIntrinsicSettings - * - * @returns {object} metadata of ManagerIntrinsicSettings - * - */ - mapper() { - return { - required: false, - serializedName: 'ManagerIntrinsicSettings', - type: { - name: 'Composite', - className: 'ManagerIntrinsicSettings', - modelProperties: { - type: { - required: true, - serializedName: 'type', - type: { - name: 'Enum', - allowedValues: [ 'GardaV1', 'HelsinkiV1' ] - } - } - } - } - }; - } -} - -module.exports = ManagerIntrinsicSettings; diff --git a/lib/services/storSimple1200Series/lib/models/managerList.js b/lib/services/storSimple1200Series/lib/models/managerList.js deleted file mode 100644 index b12f91f7ab..0000000000 --- a/lib/services/storSimple1200Series/lib/models/managerList.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * List of storsimple Managers under a particular resourceGroup - */ -class ManagerList extends Array { - /** - * Create a ManagerList. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of ManagerList - * - * @returns {object} metadata of ManagerList - * - */ - mapper() { - return { - required: false, - serializedName: 'ManagerList', - type: { - name: 'Composite', - className: 'ManagerList', - modelProperties: { - value: { - required: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ManagerElementType', - type: { - name: 'Composite', - className: 'Manager' - } - } - } - } - } - } - }; - } -} - -module.exports = ManagerList; diff --git a/lib/services/storSimple1200Series/lib/models/managerPatch.js b/lib/services/storSimple1200Series/lib/models/managerPatch.js deleted file mode 100644 index 2353f4d326..0000000000 --- a/lib/services/storSimple1200Series/lib/models/managerPatch.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * The StorSimple Manager patch. - * - */ -class ManagerPatch { - /** - * Create a ManagerPatch. - * @member {object} [tags] The tags attached to the StorSimple Manager. - */ - constructor() { - } - - /** - * Defines the metadata of ManagerPatch - * - * @returns {object} metadata of ManagerPatch - * - */ - mapper() { - return { - required: false, - serializedName: 'ManagerPatch', - type: { - name: 'Composite', - className: 'ManagerPatch', - modelProperties: { - tags: { - required: false, - serializedName: 'tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = ManagerPatch; diff --git a/lib/services/storSimple1200Series/lib/models/managerSku.js b/lib/services/storSimple1200Series/lib/models/managerSku.js deleted file mode 100644 index b0c6361ed1..0000000000 --- a/lib/services/storSimple1200Series/lib/models/managerSku.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * The Sku. - * - */ -class ManagerSku { - /** - * Create a ManagerSku. - */ - constructor() { - } - - /** - * Defines the metadata of ManagerSku - * - * @returns {object} metadata of ManagerSku - * - */ - mapper() { - return { - required: false, - serializedName: 'ManagerSku', - type: { - name: 'Composite', - className: 'ManagerSku', - modelProperties: { - name: { - required: true, - isConstant: true, - serializedName: 'name', - defaultValue: 'Standard', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ManagerSku; diff --git a/lib/services/storSimple1200Series/lib/models/message.js b/lib/services/storSimple1200Series/lib/models/message.js deleted file mode 100644 index e2718852bc..0000000000 --- a/lib/services/storSimple1200Series/lib/models/message.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Class representing a Message. - */ -class Message { - /** - * Create a Message. - * @member {string} [language] - * @member {string} [value] - */ - constructor() { - } - - /** - * Defines the metadata of Message - * - * @returns {object} metadata of Message - * - */ - mapper() { - return { - required: false, - serializedName: 'Message', - type: { - name: 'Composite', - className: 'Message', - modelProperties: { - language: { - required: false, - serializedName: 'language', - type: { - name: 'String' - } - }, - value: { - required: false, - serializedName: 'value', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = Message; diff --git a/lib/services/storSimple1200Series/lib/models/metricAvailablity.js b/lib/services/storSimple1200Series/lib/models/metricAvailablity.js deleted file mode 100644 index bfa17ae816..0000000000 --- a/lib/services/storSimple1200Series/lib/models/metricAvailablity.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Metric availability specifies the time grain (aggregation interval or - * frequency) and the retention period for that time grain - * - */ -class MetricAvailablity { - /** - * Create a MetricAvailablity. - * @member {string} timeGrain The time grain, specifies the aggregation - * interval for the metric. - * @member {string} retention The retention period for the metric at the - * specified timegrain - */ - constructor() { - } - - /** - * Defines the metadata of MetricAvailablity - * - * @returns {object} metadata of MetricAvailablity - * - */ - mapper() { - return { - required: false, - serializedName: 'MetricAvailablity', - type: { - name: 'Composite', - className: 'MetricAvailablity', - modelProperties: { - timeGrain: { - required: true, - serializedName: 'timeGrain', - type: { - name: 'String' - } - }, - retention: { - required: true, - serializedName: 'retention', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = MetricAvailablity; diff --git a/lib/services/storSimple1200Series/lib/models/metricData.js b/lib/services/storSimple1200Series/lib/models/metricData.js deleted file mode 100644 index 161da9c781..0000000000 --- a/lib/services/storSimple1200Series/lib/models/metricData.js +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * The metric data. - * - */ -class MetricData { - /** - * Create a MetricData. - * @member {date} timeStamp The time when the metric data is fetched - * @member {number} sum The sum of all the samples available in the given - * instance of time for the specific metric data - * @member {number} count The count of samples of the metric data available - * for the given instance - * @member {number} average The average of all sample for the given instance - * @member {number} minimum The minimum of all samples available - * @member {number} maximum The maximum of all samples available - */ - constructor() { - } - - /** - * Defines the metadata of MetricData - * - * @returns {object} metadata of MetricData - * - */ - mapper() { - return { - required: false, - serializedName: 'MetricData', - type: { - name: 'Composite', - className: 'MetricData', - modelProperties: { - timeStamp: { - required: true, - serializedName: 'timeStamp', - type: { - name: 'DateTime' - } - }, - sum: { - required: true, - serializedName: 'sum', - type: { - name: 'Number' - } - }, - count: { - required: true, - serializedName: 'count', - type: { - name: 'Number' - } - }, - average: { - required: true, - serializedName: 'average', - type: { - name: 'Number' - } - }, - minimum: { - required: true, - serializedName: 'minimum', - type: { - name: 'Number' - } - }, - maximum: { - required: true, - serializedName: 'maximum', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = MetricData; diff --git a/lib/services/storSimple1200Series/lib/models/metricDefinition.js b/lib/services/storSimple1200Series/lib/models/metricDefinition.js deleted file mode 100644 index 7a66d708d1..0000000000 --- a/lib/services/storSimple1200Series/lib/models/metricDefinition.js +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Monitoring metric definition represents the metadata of the metrics. - * - */ -class MetricDefinition { - /** - * Create a MetricDefinition. - * @member {object} name The metric name - * @member {string} [name.value] Name of the metric - * @member {string} [name.localizedValue] Localized name of the metric - * @member {string} unit The metric unit. Possible values include: 'Bytes', - * 'BytesPerSecond', 'Count', 'CountPerSecond', 'Percent', 'Seconds' - * @member {string} primaryAggregationType The metric aggregation type. - * Possible values include: 'Average', 'Last', 'Maximum', 'Minimum', 'None', - * 'Total' - * @member {string} resourceId The metric source id - * @member {array} metricAvailabilities The available metric granularities - * @member {array} dimensions The supported dimensions - * @member {string} type The metric definition type - */ - constructor() { - } - - /** - * Defines the metadata of MetricDefinition - * - * @returns {object} metadata of MetricDefinition - * - */ - mapper() { - return { - required: false, - serializedName: 'MetricDefinition', - type: { - name: 'Composite', - className: 'MetricDefinition', - modelProperties: { - name: { - required: true, - serializedName: 'name', - type: { - name: 'Composite', - className: 'MetricName' - } - }, - unit: { - required: true, - serializedName: 'unit', - type: { - name: 'Enum', - allowedValues: [ 'Bytes', 'BytesPerSecond', 'Count', 'CountPerSecond', 'Percent', 'Seconds' ] - } - }, - primaryAggregationType: { - required: true, - serializedName: 'primaryAggregationType', - type: { - name: 'Enum', - allowedValues: [ 'Average', 'Last', 'Maximum', 'Minimum', 'None', 'Total' ] - } - }, - resourceId: { - required: true, - serializedName: 'resourceId', - type: { - name: 'String' - } - }, - metricAvailabilities: { - required: true, - serializedName: 'metricAvailabilities', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'MetricAvailablityElementType', - type: { - name: 'Composite', - className: 'MetricAvailablity' - } - } - } - }, - dimensions: { - required: true, - serializedName: 'dimensions', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'MetricDimensionElementType', - type: { - name: 'Composite', - className: 'MetricDimension' - } - } - } - }, - type: { - required: true, - serializedName: 'type', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = MetricDefinition; diff --git a/lib/services/storSimple1200Series/lib/models/metricDefinitionList.js b/lib/services/storSimple1200Series/lib/models/metricDefinitionList.js deleted file mode 100644 index b9f897e18c..0000000000 --- a/lib/services/storSimple1200Series/lib/models/metricDefinitionList.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * List of metric definition - */ -class MetricDefinitionList extends Array { - /** - * Create a MetricDefinitionList. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of MetricDefinitionList - * - * @returns {object} metadata of MetricDefinitionList - * - */ - mapper() { - return { - required: false, - serializedName: 'MetricDefinitionList', - type: { - name: 'Composite', - className: 'MetricDefinitionList', - modelProperties: { - value: { - required: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'MetricDefinitionElementType', - type: { - name: 'Composite', - className: 'MetricDefinition' - } - } - } - } - } - } - }; - } -} - -module.exports = MetricDefinitionList; diff --git a/lib/services/storSimple1200Series/lib/models/metricDimension.js b/lib/services/storSimple1200Series/lib/models/metricDimension.js deleted file mode 100644 index aefabc78cf..0000000000 --- a/lib/services/storSimple1200Series/lib/models/metricDimension.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Metric dimension - * - */ -class MetricDimension { - /** - * Create a MetricDimension. - * @member {string} name Metric dimension name - * @member {string} value Metric dimension values - */ - constructor() { - } - - /** - * Defines the metadata of MetricDimension - * - * @returns {object} metadata of MetricDimension - * - */ - mapper() { - return { - required: false, - serializedName: 'MetricDimension', - type: { - name: 'Composite', - className: 'MetricDimension', - modelProperties: { - name: { - required: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - value: { - required: true, - serializedName: 'value', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = MetricDimension; diff --git a/lib/services/storSimple1200Series/lib/models/metricFilter.js b/lib/services/storSimple1200Series/lib/models/metricFilter.js deleted file mode 100644 index 78a64b48f2..0000000000 --- a/lib/services/storSimple1200Series/lib/models/metricFilter.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * class representing the filters to be passed while fetching metrics - * - */ -class MetricFilter { - /** - * Create a MetricFilter. - * @member {object} [name] filter for name property - * @member {string} [name.value] The value. - * @member {date} [startTime] starttime for fetching metrics - * @member {date} [endTime] endtime for fetching metrics - * @member {string} [timeGrain] timegrain of the metrics - */ - constructor() { - } - - /** - * Defines the metadata of MetricFilter - * - * @returns {object} metadata of MetricFilter - * - */ - mapper() { - return { - required: false, - serializedName: 'MetricFilter', - type: { - name: 'Composite', - className: 'MetricFilter', - modelProperties: { - name: { - required: false, - serializedName: 'name', - type: { - name: 'Composite', - className: 'MetricNameFilter' - } - }, - startTime: { - required: false, - serializedName: 'startTime', - type: { - name: 'DateTime' - } - }, - endTime: { - required: false, - serializedName: 'endTime', - type: { - name: 'DateTime' - } - }, - timeGrain: { - required: false, - serializedName: 'timeGrain', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = MetricFilter; diff --git a/lib/services/storSimple1200Series/lib/models/metricList.js b/lib/services/storSimple1200Series/lib/models/metricList.js deleted file mode 100644 index 504f2fac80..0000000000 --- a/lib/services/storSimple1200Series/lib/models/metricList.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Collection of metrics - */ -class MetricList extends Array { - /** - * Create a MetricList. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of MetricList - * - * @returns {object} metadata of MetricList - * - */ - mapper() { - return { - required: false, - serializedName: 'MetricList', - type: { - name: 'Composite', - className: 'MetricList', - modelProperties: { - value: { - required: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'MetricsElementType', - type: { - name: 'Composite', - className: 'Metrics' - } - } - } - } - } - } - }; - } -} - -module.exports = MetricList; diff --git a/lib/services/storSimple1200Series/lib/models/metricName.js b/lib/services/storSimple1200Series/lib/models/metricName.js deleted file mode 100644 index c926c60096..0000000000 --- a/lib/services/storSimple1200Series/lib/models/metricName.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * The name of the metric - * - */ -class MetricName { - /** - * Create a MetricName. - * @member {string} value Name of the metric - * @member {string} localizedValue Localized name of the metric - */ - constructor() { - } - - /** - * Defines the metadata of MetricName - * - * @returns {object} metadata of MetricName - * - */ - mapper() { - return { - required: false, - serializedName: 'MetricName', - type: { - name: 'Composite', - className: 'MetricName', - modelProperties: { - value: { - required: true, - serializedName: 'value', - type: { - name: 'String' - } - }, - localizedValue: { - required: true, - serializedName: 'localizedValue', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = MetricName; diff --git a/lib/services/storSimple1200Series/lib/models/metricNameFilter.js b/lib/services/storSimple1200Series/lib/models/metricNameFilter.js deleted file mode 100644 index ecc4571b25..0000000000 --- a/lib/services/storSimple1200Series/lib/models/metricNameFilter.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Class representing the name filter to be passed while fetching metrics - * - */ -class MetricNameFilter { - /** - * Create a MetricNameFilter. - * @member {string} [value] The value. - */ - constructor() { - } - - /** - * Defines the metadata of MetricNameFilter - * - * @returns {object} metadata of MetricNameFilter - * - */ - mapper() { - return { - required: false, - serializedName: 'MetricNameFilter', - type: { - name: 'Composite', - className: 'MetricNameFilter', - modelProperties: { - value: { - required: false, - serializedName: 'value', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = MetricNameFilter; diff --git a/lib/services/storSimple1200Series/lib/models/metrics.js b/lib/services/storSimple1200Series/lib/models/metrics.js deleted file mode 100644 index 185e8c6353..0000000000 --- a/lib/services/storSimple1200Series/lib/models/metrics.js +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Monitoring metric - * - */ -class Metrics { - /** - * Create a Metrics. - * @member {string} resourceId The id of metric source - * @member {date} startTime The metric start time - * @member {date} endTime The metric end time - * @member {string} timeGrain The time grain, time grain indicates frequency - * of the metric data - * @member {string} primaryAggregation The metric aggregation type. Possible - * values include: 'Average', 'Last', 'Maximum', 'Minimum', 'None', 'Total' - * @member {object} name The name of the metrics - * @member {string} [name.value] Name of the metric - * @member {string} [name.localizedValue] Localized name of the metric - * @member {array} dimensions The Metric dimension which indicates the source - * of the metric - * @member {string} unit The unit of the metric data. Possible values - * include: 'Bytes', 'BytesPerSecond', 'Count', 'CountPerSecond', 'Percent', - * 'Seconds' - * @member {string} type The Type of the metric data - * @member {array} values The metric data - */ - constructor() { - } - - /** - * Defines the metadata of Metrics - * - * @returns {object} metadata of Metrics - * - */ - mapper() { - return { - required: false, - serializedName: 'Metrics', - type: { - name: 'Composite', - className: 'Metrics', - modelProperties: { - resourceId: { - required: true, - serializedName: 'resourceId', - type: { - name: 'String' - } - }, - startTime: { - required: true, - serializedName: 'startTime', - type: { - name: 'DateTime' - } - }, - endTime: { - required: true, - serializedName: 'endTime', - type: { - name: 'DateTime' - } - }, - timeGrain: { - required: true, - serializedName: 'timeGrain', - type: { - name: 'String' - } - }, - primaryAggregation: { - required: true, - serializedName: 'primaryAggregation', - type: { - name: 'Enum', - allowedValues: [ 'Average', 'Last', 'Maximum', 'Minimum', 'None', 'Total' ] - } - }, - name: { - required: true, - serializedName: 'name', - type: { - name: 'Composite', - className: 'MetricName' - } - }, - dimensions: { - required: true, - serializedName: 'dimensions', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'MetricDimensionElementType', - type: { - name: 'Composite', - className: 'MetricDimension' - } - } - } - }, - unit: { - required: true, - serializedName: 'unit', - type: { - name: 'Enum', - allowedValues: [ 'Bytes', 'BytesPerSecond', 'Count', 'CountPerSecond', 'Percent', 'Seconds' ] - } - }, - type: { - required: true, - serializedName: 'type', - type: { - name: 'String' - } - }, - values: { - required: true, - serializedName: 'values', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'MetricDataElementType', - type: { - name: 'Composite', - className: 'MetricData' - } - } - } - } - } - } - }; - } -} - -module.exports = Metrics; diff --git a/lib/services/storSimple1200Series/lib/models/networkAdapter.js b/lib/services/storSimple1200Series/lib/models/networkAdapter.js deleted file mode 100644 index d54a09caee..0000000000 --- a/lib/services/storSimple1200Series/lib/models/networkAdapter.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Represents a networkAdapter in a particular node. - * - */ -class NetworkAdapter { - /** - * Create a NetworkAdapter. - * @member {string} networkAdapterName The name of the network adapter. - * @member {object} [iPv4Info] The ipv4 configuration of the network adapter. - * @member {string} [iPv4Info.ipAddress] The ipaddress of the network - * adapter, either ipv4 or ipv6. - * @member {number} [iPv4Info.prefixLength] The prefix length of the network - * adapter. - * @member {string} [iPv4Info.gateway] The gateway of the network adapter. - * @member {object} [iPv6Info] The ipv6 configuration of the network adapter. - * @member {string} [iPv6Info.ipAddress] The ipaddress of the network - * adapter, either ipv4 or ipv6. - * @member {number} [iPv6Info.prefixLength] The prefix length of the network - * adapter. - * @member {string} [iPv6Info.gateway] The gateway of the network adapter. - * @member {string} dhcpStatus Represents state of DHCP. Possible values - * include: 'Enabled', 'Disabled' - * @member {number} [linkSpeed] The speed of the network adapter. - */ - constructor() { - } - - /** - * Defines the metadata of NetworkAdapter - * - * @returns {object} metadata of NetworkAdapter - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkAdapter', - type: { - name: 'Composite', - className: 'NetworkAdapter', - modelProperties: { - networkAdapterName: { - required: true, - serializedName: 'networkAdapterName', - type: { - name: 'String' - } - }, - iPv4Info: { - required: false, - serializedName: 'iPv4Info', - type: { - name: 'Composite', - className: 'IPConfig' - } - }, - iPv6Info: { - required: false, - serializedName: 'iPv6Info', - type: { - name: 'Composite', - className: 'IPConfig' - } - }, - dhcpStatus: { - required: true, - serializedName: 'dhcpStatus', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - }, - linkSpeed: { - required: false, - serializedName: 'linkSpeed', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = NetworkAdapter; diff --git a/lib/services/storSimple1200Series/lib/models/networkSettings.js b/lib/services/storSimple1200Series/lib/models/networkSettings.js deleted file mode 100644 index acb2f20672..0000000000 --- a/lib/services/storSimple1200Series/lib/models/networkSettings.js +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The NetworkSettings of a device - * - * @extends models['BaseModel'] - */ -class NetworkSettings extends models['BaseModel'] { - /** - * Create a NetworkSettings. - * @member {string} primaryDnsServer The Primary DNS server for the device - * @member {string} [secondaryDnsServer] The secondary DNS server for the - * device - * @member {array} nodeNetworks The NetworkAdapters under each node of the - * device. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of NetworkSettings - * - * @returns {object} metadata of NetworkSettings - * - */ - mapper() { - return { - required: false, - serializedName: 'NetworkSettings', - type: { - name: 'Composite', - className: 'NetworkSettings', - 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' - } - }, - primaryDnsServer: { - required: true, - serializedName: 'properties.primaryDnsServer', - type: { - name: 'String' - } - }, - secondaryDnsServer: { - required: false, - serializedName: 'properties.secondaryDnsServer', - type: { - name: 'String' - } - }, - nodeNetworks: { - required: true, - serializedName: 'properties.nodeNetworks', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NodeNetworkElementType', - type: { - name: 'Composite', - className: 'NodeNetwork' - } - } - } - } - } - } - }; - } -} - -module.exports = NetworkSettings; diff --git a/lib/services/storSimple1200Series/lib/models/nodeNetwork.js b/lib/services/storSimple1200Series/lib/models/nodeNetwork.js deleted file mode 100644 index f66984f859..0000000000 --- a/lib/services/storSimple1200Series/lib/models/nodeNetwork.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Represents a single node in a device. - * - */ -class NodeNetwork { - /** - * Create a NodeNetwork. - * @member {array} networkAdapters The array of network adapters in the node. - */ - constructor() { - } - - /** - * Defines the metadata of NodeNetwork - * - * @returns {object} metadata of NodeNetwork - * - */ - mapper() { - return { - required: false, - serializedName: 'NodeNetwork', - type: { - name: 'Composite', - className: 'NodeNetwork', - modelProperties: { - networkAdapters: { - required: true, - serializedName: 'networkAdapters', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'NetworkAdapterElementType', - type: { - name: 'Composite', - className: 'NetworkAdapter' - } - } - } - } - } - } - }; - } -} - -module.exports = NodeNetwork; diff --git a/lib/services/storSimple1200Series/lib/models/resource.js b/lib/services/storSimple1200Series/lib/models/resource.js deleted file mode 100644 index 14a787a1f7..0000000000 --- a/lib/services/storSimple1200Series/lib/models/resource.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The Azure Resource. - * - * @extends models['BaseResource'] - */ -class Resource extends models['BaseResource'] { - /** - * Create a Resource. - * @member {string} [id] The Resource Id - * @member {string} [name] The Resource Name - * @member {string} [type] The Resource type - * @member {string} location The Geo location of the Manager - * @member {object} [tags] Tags attached to the Manager - */ - constructor() { - super(); - } - - /** - * Defines the metadata of Resource - * - * @returns {object} metadata of Resource - * - */ - mapper() { - return { - required: false, - serializedName: 'Resource', - type: { - name: 'Composite', - className: 'Resource', - 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' - } - } - } - } - } - } - }; - } -} - -module.exports = Resource; diff --git a/lib/services/storSimple1200Series/lib/models/securitySettings.js b/lib/services/storSimple1200Series/lib/models/securitySettings.js deleted file mode 100644 index a842e7a7b3..0000000000 --- a/lib/services/storSimple1200Series/lib/models/securitySettings.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The SecuritySettings of a device - * - * @extends models['BaseModel'] - */ -class SecuritySettings extends models['BaseModel'] { - /** - * Create a SecuritySettings. - * @member {object} deviceAdminPassword Device administrator password as an - * encrypted string (encrypted using RSA PKCS #1) is used to log into the - * local web UI of the device. Actual password could have at least 8 - * characters that are a combination of uppercase, lowercase, numeric, and - * special characters - * @member {string} [deviceAdminPassword.value] The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be - * none and EncryptionCertThumbprint will be null. - * @member {string} [deviceAdminPassword.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * @member {string} [deviceAdminPassword.encryptionAlgorithm] Algorithm used - * to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - */ - constructor() { - super(); - } - - /** - * Defines the metadata of SecuritySettings - * - * @returns {object} metadata of SecuritySettings - * - */ - mapper() { - return { - required: false, - serializedName: 'SecuritySettings', - type: { - name: 'Composite', - className: 'SecuritySettings', - 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' - } - }, - deviceAdminPassword: { - required: true, - serializedName: 'properties.deviceAdminPassword', - type: { - name: 'Composite', - className: 'AsymmetricEncryptedSecret' - } - } - } - } - }; - } -} - -module.exports = SecuritySettings; diff --git a/lib/services/storSimple1200Series/lib/models/sendTestAlertEmailRequest.js b/lib/services/storSimple1200Series/lib/models/sendTestAlertEmailRequest.js deleted file mode 100644 index f2a2697216..0000000000 --- a/lib/services/storSimple1200Series/lib/models/sendTestAlertEmailRequest.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Request for sending test alert email - * - */ -class SendTestAlertEmailRequest { - /** - * Create a SendTestAlertEmailRequest. - * @member {array} emailList List of emails to send the test alerts - */ - constructor() { - } - - /** - * Defines the metadata of SendTestAlertEmailRequest - * - * @returns {object} metadata of SendTestAlertEmailRequest - * - */ - mapper() { - return { - required: false, - serializedName: 'SendTestAlertEmailRequest', - type: { - name: 'Composite', - className: 'SendTestAlertEmailRequest', - modelProperties: { - emailList: { - required: true, - serializedName: 'emailList', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - } - } - } - }; - } -} - -module.exports = SendTestAlertEmailRequest; diff --git a/lib/services/storSimple1200Series/lib/models/storageAccountCredential.js b/lib/services/storSimple1200Series/lib/models/storageAccountCredential.js deleted file mode 100644 index b37e7bef4b..0000000000 --- a/lib/services/storSimple1200Series/lib/models/storageAccountCredential.js +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The storage account credential - * - * @extends models['BaseModel'] - */ -class StorageAccountCredential extends models['BaseModel'] { - /** - * Create a StorageAccountCredential. - * @member {string} cloudType The cloud service provider. Possible values - * include: 'Azure', 'S3', 'S3_RRS', 'OpenStack', 'HP' - * @member {string} endPoint The storage endpoint - * @member {string} login The storage account login - * @member {string} [location] The storage account's geo location - * @member {string} enableSSL SSL needs to be enabled or not. Possible values - * include: 'Enabled', 'Disabled' - * @member {object} [accessKey] The details of the storage account password - * @member {string} [accessKey.value] The value of the secret itself. If the - * secret is in plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. - * @member {string} [accessKey.encryptionCertificateThumbprint] Thumbprint - * certificate that was used to encrypt "Value" - * @member {string} [accessKey.encryptionAlgorithm] Algorithm used to encrypt - * "Value". Possible values include: 'None', 'AES256', 'RSAES_PKCS1_v_1_5' - */ - constructor() { - super(); - } - - /** - * Defines the metadata of StorageAccountCredential - * - * @returns {object} metadata of StorageAccountCredential - * - */ - mapper() { - return { - required: false, - serializedName: 'StorageAccountCredential', - type: { - name: 'Composite', - className: 'StorageAccountCredential', - 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' - } - }, - cloudType: { - required: true, - serializedName: 'properties.cloudType', - type: { - name: 'Enum', - allowedValues: [ 'Azure', 'S3', 'S3_RRS', 'OpenStack', 'HP' ] - } - }, - endPoint: { - required: true, - serializedName: 'properties.endPoint', - type: { - name: 'String' - } - }, - login: { - required: true, - serializedName: 'properties.login', - type: { - name: 'String' - } - }, - location: { - required: false, - serializedName: 'properties.location', - type: { - name: 'String' - } - }, - enableSSL: { - required: true, - serializedName: 'properties.enableSSL', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - }, - accessKey: { - required: false, - serializedName: 'properties.accessKey', - type: { - name: 'Composite', - className: 'AsymmetricEncryptedSecret' - } - } - } - } - }; - } -} - -module.exports = StorageAccountCredential; diff --git a/lib/services/storSimple1200Series/lib/models/storageAccountCredentialList.js b/lib/services/storSimple1200Series/lib/models/storageAccountCredentialList.js deleted file mode 100644 index e3a63c3771..0000000000 --- a/lib/services/storSimple1200Series/lib/models/storageAccountCredentialList.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Collection of Storage account credential entities - */ -class StorageAccountCredentialList extends Array { - /** - * Create a StorageAccountCredentialList. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of StorageAccountCredentialList - * - * @returns {object} metadata of StorageAccountCredentialList - * - */ - mapper() { - return { - required: false, - serializedName: 'StorageAccountCredentialList', - type: { - name: 'Composite', - className: 'StorageAccountCredentialList', - modelProperties: { - value: { - required: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StorageAccountCredentialElementType', - type: { - name: 'Composite', - className: 'StorageAccountCredential' - } - } - } - } - } - } - }; - } -} - -module.exports = StorageAccountCredentialList; diff --git a/lib/services/storSimple1200Series/lib/models/storageDomain.js b/lib/services/storSimple1200Series/lib/models/storageDomain.js deleted file mode 100644 index ee44d14cfc..0000000000 --- a/lib/services/storSimple1200Series/lib/models/storageDomain.js +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The storage domain. - * - * @extends models['BaseModel'] - */ -class StorageDomain extends models['BaseModel'] { - /** - * Create a StorageDomain. - * @member {array} storageAccountCredentialIds The storage account - * credentials. - * @member {object} [encryptionKey] The encryption key used to encrypt the - * data. This is a user secret. - * @member {string} [encryptionKey.value] The value of the secret itself. If - * the secret is in plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. - * @member {string} [encryptionKey.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * @member {string} [encryptionKey.encryptionAlgorithm] Algorithm used to - * encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * @member {string} encryptionStatus The encryption status "Enabled | - * Disabled". Possible values include: 'Enabled', 'Disabled' - */ - constructor() { - super(); - } - - /** - * Defines the metadata of StorageDomain - * - * @returns {object} metadata of StorageDomain - * - */ - mapper() { - return { - required: false, - serializedName: 'StorageDomain', - type: { - name: 'Composite', - className: 'StorageDomain', - 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' - } - }, - storageAccountCredentialIds: { - required: true, - serializedName: 'properties.storageAccountCredentialIds', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - encryptionKey: { - required: false, - serializedName: 'properties.encryptionKey', - type: { - name: 'Composite', - className: 'AsymmetricEncryptedSecret' - } - }, - encryptionStatus: { - required: true, - serializedName: 'properties.encryptionStatus', - type: { - name: 'Enum', - allowedValues: [ 'Enabled', 'Disabled' ] - } - } - } - } - }; - } -} - -module.exports = StorageDomain; diff --git a/lib/services/storSimple1200Series/lib/models/storageDomainList.js b/lib/services/storSimple1200Series/lib/models/storageDomainList.js deleted file mode 100644 index be9cfbcdb9..0000000000 --- a/lib/services/storSimple1200Series/lib/models/storageDomainList.js +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Collection of storage domains - */ -class StorageDomainList extends Array { - /** - * Create a StorageDomainList. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of StorageDomainList - * - * @returns {object} metadata of StorageDomainList - * - */ - mapper() { - return { - required: false, - serializedName: 'StorageDomainList', - type: { - name: 'Composite', - className: 'StorageDomainList', - modelProperties: { - value: { - required: true, - serializedName: '', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StorageDomainElementType', - type: { - name: 'Composite', - className: 'StorageDomain' - } - } - } - } - } - } - }; - } -} - -module.exports = StorageDomainList; diff --git a/lib/services/storSimple1200Series/lib/models/symmetricEncryptedSecret.js b/lib/services/storSimple1200Series/lib/models/symmetricEncryptedSecret.js deleted file mode 100644 index 74913be36e..0000000000 --- a/lib/services/storSimple1200Series/lib/models/symmetricEncryptedSecret.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * This class can be used as the Type for any secret entity represented as - * Value, ValueCertificateThumbprint, EncryptionAlgorithm. In this case, - * "Value" is a secret and the "valueThumbprint" represents the certificate - * thumbprint of the value. The algorithm field is mainly for future usage to - * potentially allow different entities encrypted using different algorithms. - * - */ -class SymmetricEncryptedSecret { - /** - * Create a SymmetricEncryptedSecret. - * @member {string} value The value of the secret itself. If the secret is in - * plaintext or null then EncryptionAlgorithm will be none - * @member {string} [valueCertificateThumbprint] Thumbprint cert that was - * used to encrypt "Value" - * @member {string} encryptionAlgorithm Algorithm used to encrypt "Value". - * Possible values include: 'None', 'AES256', 'RSAES_PKCS1_v_1_5' - */ - constructor() { - } - - /** - * Defines the metadata of SymmetricEncryptedSecret - * - * @returns {object} metadata of SymmetricEncryptedSecret - * - */ - mapper() { - return { - required: false, - serializedName: 'SymmetricEncryptedSecret', - type: { - name: 'Composite', - className: 'SymmetricEncryptedSecret', - modelProperties: { - value: { - required: true, - serializedName: 'value', - type: { - name: 'String' - } - }, - valueCertificateThumbprint: { - required: false, - serializedName: 'valueCertificateThumbprint', - type: { - name: 'String' - } - }, - encryptionAlgorithm: { - required: true, - serializedName: 'encryptionAlgorithm', - type: { - name: 'Enum', - allowedValues: [ 'None', 'AES256', 'RSAES_PKCS1_v_1_5' ] - } - } - } - } - }; - } -} - -module.exports = SymmetricEncryptedSecret; diff --git a/lib/services/storSimple1200Series/lib/models/time.js b/lib/services/storSimple1200Series/lib/models/time.js deleted file mode 100644 index bcb81f1c39..0000000000 --- a/lib/services/storSimple1200Series/lib/models/time.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * The Time. - * - */ -class Time { - /** - * Create a Time. - * @member {number} hour The hour. - * @member {number} minute The minute. - */ - constructor() { - } - - /** - * Defines the metadata of Time - * - * @returns {object} metadata of Time - * - */ - mapper() { - return { - required: false, - serializedName: 'Time', - type: { - name: 'Composite', - className: 'Time', - modelProperties: { - hour: { - required: true, - serializedName: 'hour', - constraints: { - InclusiveMaximum: 23, - InclusiveMinimum: 0 - }, - type: { - name: 'Number' - } - }, - minute: { - required: true, - serializedName: 'minute', - constraints: { - InclusiveMaximum: 59, - InclusiveMinimum: 0 - }, - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = Time; diff --git a/lib/services/storSimple1200Series/lib/models/timeSettings.js b/lib/services/storSimple1200Series/lib/models/timeSettings.js deleted file mode 100644 index dddfff2ff2..0000000000 --- a/lib/services/storSimple1200Series/lib/models/timeSettings.js +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The TimeSettings of a device - * - * @extends models['BaseModel'] - */ -class TimeSettings extends models['BaseModel'] { - /** - * Create a TimeSettings. - * @member {string} timeZone The timezone of device, like '(UTC -06:00) - * Central America' - * @member {string} primaryTimeServer The primary Network Time Protocol (NTP) - * server name, like 'time.windows.com'. - * @member {string} [secondaryTimeServer] The secondary Network Time Protocol - * (NTP) server name, like 'time.contoso.com'. It's optional. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of TimeSettings - * - * @returns {object} metadata of TimeSettings - * - */ - mapper() { - return { - required: false, - serializedName: 'TimeSettings', - type: { - name: 'Composite', - className: 'TimeSettings', - 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' - } - }, - timeZone: { - required: true, - serializedName: 'properties.timeZone', - type: { - name: 'String' - } - }, - primaryTimeServer: { - required: true, - serializedName: 'properties.primaryTimeServer', - type: { - name: 'String' - } - }, - secondaryTimeServer: { - required: false, - serializedName: 'properties.secondaryTimeServer', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = TimeSettings; diff --git a/lib/services/storSimple1200Series/lib/models/updateDownloadProgress.js b/lib/services/storSimple1200Series/lib/models/updateDownloadProgress.js deleted file mode 100644 index de3b0cbc00..0000000000 --- a/lib/services/storSimple1200Series/lib/models/updateDownloadProgress.js +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * details available during the download - * - */ -class UpdateDownloadProgress { - /** - * Create a UpdateDownloadProgress. - * @member {string} [downloadPhase] The download phase. Possible values - * include: 'Unknown', 'Initializing', 'Downloading', 'Verifying' - * @member {number} [percentComplete] Percentage of completion. - * @member {number} [totalBytesToDownload] Total bytes to download. - * @member {number} [totalBytesDownloaded] Total bytes downloaded. - * @member {number} [numberOfUpdatesToDownload] Number of updates to - * download. - * @member {number} [numberOfUpdatesDownloaded] Number of updates downloaded. - */ - constructor() { - } - - /** - * Defines the metadata of UpdateDownloadProgress - * - * @returns {object} metadata of UpdateDownloadProgress - * - */ - mapper() { - return { - required: false, - serializedName: 'UpdateDownloadProgress', - type: { - name: 'Composite', - className: 'UpdateDownloadProgress', - modelProperties: { - downloadPhase: { - required: false, - serializedName: 'downloadPhase', - type: { - name: 'Enum', - allowedValues: [ 'Unknown', 'Initializing', 'Downloading', 'Verifying' ] - } - }, - percentComplete: { - required: false, - serializedName: 'percentComplete', - type: { - name: 'Number' - } - }, - totalBytesToDownload: { - required: false, - serializedName: 'totalBytesToDownload', - type: { - name: 'Number' - } - }, - totalBytesDownloaded: { - required: false, - serializedName: 'totalBytesDownloaded', - type: { - name: 'Number' - } - }, - numberOfUpdatesToDownload: { - required: false, - serializedName: 'numberOfUpdatesToDownload', - type: { - name: 'Number' - } - }, - numberOfUpdatesDownloaded: { - required: false, - serializedName: 'numberOfUpdatesDownloaded', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = UpdateDownloadProgress; diff --git a/lib/services/storSimple1200Series/lib/models/updateInstallProgress.js b/lib/services/storSimple1200Series/lib/models/updateInstallProgress.js deleted file mode 100644 index 3aa3a11090..0000000000 --- a/lib/services/storSimple1200Series/lib/models/updateInstallProgress.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Class representing the progress during installation of updates - * - */ -class UpdateInstallProgress { - /** - * Create a UpdateInstallProgress. - * @member {number} [percentComplete] Percentage of completion. - * @member {number} [numberOfUpdatesToInstall] Number of updates to install. - * @member {number} [numberOfUpdatesInstalled] Number of updates installed. - */ - constructor() { - } - - /** - * Defines the metadata of UpdateInstallProgress - * - * @returns {object} metadata of UpdateInstallProgress - * - */ - mapper() { - return { - required: false, - serializedName: 'UpdateInstallProgress', - type: { - name: 'Composite', - className: 'UpdateInstallProgress', - modelProperties: { - percentComplete: { - required: false, - serializedName: 'percentComplete', - type: { - name: 'Number' - } - }, - numberOfUpdatesToInstall: { - required: false, - serializedName: 'numberOfUpdatesToInstall', - type: { - name: 'Number' - } - }, - numberOfUpdatesInstalled: { - required: false, - serializedName: 'numberOfUpdatesInstalled', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = UpdateInstallProgress; diff --git a/lib/services/storSimple1200Series/lib/models/updates.js b/lib/services/storSimple1200Series/lib/models/updates.js deleted file mode 100644 index a93bb3e8bd..0000000000 --- a/lib/services/storSimple1200Series/lib/models/updates.js +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The updates profile - * - * @extends models['BaseModel'] - */ -class Updates extends models['BaseModel'] { - /** - * Create a Updates. - * @member {string} [deviceVersion] The current Device version. - * @member {date} [deviceLastScannedTime] The last time when the device did - * an update scan. - * @member {boolean} [regularUpdatesAvailable] Set to true if regular updates - * were detected for the current version of the device. - * @member {boolean} [rebootRequiredForInstall] Set to true if - * RegularUpdatesAvailable is true and if atleast one of the updateItems - * detected has needs a reboot to install. - * @member {number} [totalItemsPendingForDownload] The total number of items - * pending for download. - * @member {number} [totalItemsPendingForInstall] The total number of items - * pending for install. - * @member {string} [status] The current update operation. Possible values - * include: 'Idle', 'Scanning', 'Downloading', 'Installing' - * @member {date} [lastCompletedScanTime] The time when the last scan job was - * completed (success|cancelled|failed) on the device. - * @member {date} [lastCompletedDownloadJobTime] The time when the last - * Download job was completed (success|cancelled|failed) on the device. - * @member {date} [lastCompletedInstallJobTime] The time when the last - * Install job was completed (success|cancelled|failed) on the device. - * @member {string} [inProgressDownloadJobId] If a download is in progress, - * this field contains the JobId of that particular download job - * @member {string} [inProgressInstallJobId] If an install is in progress, - * this field contains the JobId of that particular install job - * @member {date} [inProgressScanStartedTime] The time when the currently - * running scan (if any) started - * @member {date} [inProgressDownloadJobStartedTime] The time when the - * currently running download (if any) started - * @member {date} [inProgressInstallJobStartedTime] The time when the - * currently running install (if any) started - */ - constructor() { - super(); - } - - /** - * Defines the metadata of Updates - * - * @returns {object} metadata of Updates - * - */ - mapper() { - return { - required: false, - serializedName: 'Updates', - type: { - name: 'Composite', - className: 'Updates', - 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' - } - }, - deviceVersion: { - required: false, - serializedName: 'properties.deviceVersion', - type: { - name: 'String' - } - }, - deviceLastScannedTime: { - required: false, - serializedName: 'properties.deviceLastScannedTime', - type: { - name: 'DateTime' - } - }, - regularUpdatesAvailable: { - required: false, - serializedName: 'properties.regularUpdatesAvailable', - type: { - name: 'Boolean' - } - }, - rebootRequiredForInstall: { - required: false, - serializedName: 'properties.rebootRequiredForInstall', - type: { - name: 'Boolean' - } - }, - totalItemsPendingForDownload: { - required: false, - serializedName: 'properties.totalItemsPendingForDownload', - type: { - name: 'Number' - } - }, - totalItemsPendingForInstall: { - required: false, - serializedName: 'properties.totalItemsPendingForInstall', - type: { - name: 'Number' - } - }, - status: { - required: false, - serializedName: 'properties.status', - type: { - name: 'Enum', - allowedValues: [ 'Idle', 'Scanning', 'Downloading', 'Installing' ] - } - }, - lastCompletedScanTime: { - required: false, - serializedName: 'properties.lastCompletedScanTime', - type: { - name: 'DateTime' - } - }, - lastCompletedDownloadJobTime: { - required: false, - serializedName: 'properties.lastCompletedDownloadJobTime', - type: { - name: 'DateTime' - } - }, - lastCompletedInstallJobTime: { - required: false, - serializedName: 'properties.lastCompletedInstallJobTime', - type: { - name: 'DateTime' - } - }, - inProgressDownloadJobId: { - required: false, - serializedName: 'properties.inProgressDownloadJobId', - type: { - name: 'String' - } - }, - inProgressInstallJobId: { - required: false, - serializedName: 'properties.inProgressInstallJobId', - type: { - name: 'String' - } - }, - inProgressScanStartedTime: { - required: false, - serializedName: 'properties.inProgressScanStartedTime', - type: { - name: 'DateTime' - } - }, - inProgressDownloadJobStartedTime: { - required: false, - serializedName: 'properties.inProgressDownloadJobStartedTime', - type: { - name: 'DateTime' - } - }, - inProgressInstallJobStartedTime: { - required: false, - serializedName: 'properties.inProgressInstallJobStartedTime', - type: { - name: 'DateTime' - } - } - } - } - }; - } -} - -module.exports = Updates; diff --git a/lib/services/storSimple1200Series/lib/models/uploadCertificateRequest.js b/lib/services/storSimple1200Series/lib/models/uploadCertificateRequest.js deleted file mode 100644 index 6f8eb3902b..0000000000 --- a/lib/services/storSimple1200Series/lib/models/uploadCertificateRequest.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Upload Certificate Request to IDM - * - */ -class UploadCertificateRequest { - /** - * Create a UploadCertificateRequest. - * @member {string} [authType] Specify the Authentication type. Possible - * values include: 'Invalid', 'AccessControlService', 'AzureActiveDirectory' - * @member {string} certificate Gets or sets the base64 encoded certificate - * raw data string - * @member {string} [contractVersion] Gets ContractVersion. Possible values - * include: 'InvalidVersion', 'V2011_09', 'V2012_02', 'V2012_05', 'V2012_12', - * 'V2013_04', 'V2013_10', 'V2013_11', 'V2014_04', 'V2014_06', 'V2014_07', - * 'V2014_09', 'V2014_10', 'V2014_12', 'V2015_01', 'V2015_02', 'V2015_04', - * 'V2015_05', 'V2015_06', 'V2015_07', 'V2015_08', 'V2015_10', 'V2015_12', - * 'V2016_01', 'V2016_02', 'V2016_04', 'V2016_05', 'V2016_07', 'V2016_08' - */ - constructor() { - } - - /** - * Defines the metadata of UploadCertificateRequest - * - * @returns {object} metadata of UploadCertificateRequest - * - */ - mapper() { - return { - required: false, - serializedName: 'UploadCertificateRequest', - type: { - name: 'Composite', - className: 'UploadCertificateRequest', - modelProperties: { - authType: { - required: false, - serializedName: 'properties.authType', - type: { - name: 'Enum', - allowedValues: [ 'Invalid', 'AccessControlService', 'AzureActiveDirectory' ] - } - }, - certificate: { - required: true, - serializedName: 'properties.certificate', - type: { - name: 'String' - } - }, - contractVersion: { - required: false, - readOnly: true, - serializedName: 'contractVersion', - type: { - name: 'Enum', - allowedValues: [ 'InvalidVersion', 'V2011_09', 'V2012_02', 'V2012_05', 'V2012_12', 'V2013_04', 'V2013_10', 'V2013_11', 'V2014_04', 'V2014_06', 'V2014_07', 'V2014_09', 'V2014_10', 'V2014_12', 'V2015_01', 'V2015_02', 'V2015_04', 'V2015_05', 'V2015_06', 'V2015_07', 'V2015_08', 'V2015_10', 'V2015_12', 'V2016_01', 'V2016_02', 'V2016_04', 'V2016_05', 'V2016_07', 'V2016_08' ] - } - } - } - } - }; - } -} - -module.exports = UploadCertificateRequest; diff --git a/lib/services/storSimple1200Series/lib/models/uploadCertificateResponse.js b/lib/services/storSimple1200Series/lib/models/uploadCertificateResponse.js deleted file mode 100644 index ae6fcf4a01..0000000000 --- a/lib/services/storSimple1200Series/lib/models/uploadCertificateResponse.js +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Upload Certificate Response from IDM - * - * @extends models['BaseModel'] - */ -class UploadCertificateResponse extends models['BaseModel'] { - /** - * Create a UploadCertificateResponse. - * @member {string} [authType] Specify the Authentication type. Possible - * values include: 'Invalid', 'AccessControlService', 'AzureActiveDirectory' - * @member {string} certificate Gets or sets the base64 encoded certificate - * raw data string - * @member {number} resourceId Gets or Sets the ResourceId - * @member {string} aadAuthority AAD tenant authority - * @member {string} aadTenantId AAD tenant Id - * @member {string} servicePrincipalClientId AAD service principal clientId - * @member {string} servicePrincipalObjectId AAD service principal ObjectId - * @member {string} azureManagementEndpointAudience Azure Management Endpoint - * Audience - * @member {string} subject Certificate Subject Name - * @member {date} validFrom Certificate Validity start Date time - * @member {date} validTo Certificate Validity End Date time - * @member {string} thumbprint Certificate thumbrprint - * @member {string} friendlyName Certificate friendlyname - * @member {string} issuer Certificate issuer - */ - constructor() { - super(); - } - - /** - * Defines the metadata of UploadCertificateResponse - * - * @returns {object} metadata of UploadCertificateResponse - * - */ - mapper() { - return { - required: false, - serializedName: 'UploadCertificateResponse', - type: { - name: 'Composite', - className: 'UploadCertificateResponse', - 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' - } - }, - authType: { - required: false, - serializedName: 'properties.authType', - type: { - name: 'Enum', - allowedValues: [ 'Invalid', 'AccessControlService', 'AzureActiveDirectory' ] - } - }, - certificate: { - required: true, - serializedName: 'properties.certificate', - type: { - name: 'String' - } - }, - resourceId: { - required: true, - serializedName: 'properties.resourceId', - type: { - name: 'Number' - } - }, - aadAuthority: { - required: true, - serializedName: 'properties.aadAuthority', - type: { - name: 'String' - } - }, - aadTenantId: { - required: true, - serializedName: 'properties.aadTenantId', - type: { - name: 'String' - } - }, - servicePrincipalClientId: { - required: true, - serializedName: 'properties.servicePrincipalClientId', - type: { - name: 'String' - } - }, - servicePrincipalObjectId: { - required: true, - serializedName: 'properties.servicePrincipalObjectId', - type: { - name: 'String' - } - }, - azureManagementEndpointAudience: { - required: true, - serializedName: 'properties.azureManagementEndpointAudience', - type: { - name: 'String' - } - }, - subject: { - required: true, - serializedName: 'properties.subject', - type: { - name: 'String' - } - }, - validFrom: { - required: true, - serializedName: 'properties.validFrom', - type: { - name: 'DateTime' - } - }, - validTo: { - required: true, - serializedName: 'properties.validTo', - type: { - name: 'DateTime' - } - }, - thumbprint: { - required: true, - serializedName: 'properties.thumbprint', - type: { - name: 'String' - } - }, - friendlyName: { - required: true, - serializedName: 'properties.friendlyName', - type: { - name: 'String' - } - }, - issuer: { - required: true, - serializedName: 'properties.issuer', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = UploadCertificateResponse; diff --git a/lib/services/storSimple1200Series/lib/operations/accessControlRecords.js b/lib/services/storSimple1200Series/lib/operations/accessControlRecords.js deleted file mode 100644 index e5cc52cd00..0000000000 --- a/lib/services/storSimple1200Series/lib/operations/accessControlRecords.js +++ /dev/null @@ -1,1408 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * Retrieves all the access control records in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 AccessControlRecordList} 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 _listByManager(resourceGroupName, managerName, 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.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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['AccessControlRecordList']().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); - }); -} - -/** - * Returns the properties of the specified access control record name. - * - * @param {string} accessControlRecordName Name of access control record to be - * fetched. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 AccessControlRecord} 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(accessControlRecordName, resourceGroupName, managerName, 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 (accessControlRecordName === null || accessControlRecordName === undefined || typeof accessControlRecordName.valueOf() !== 'string') { - throw new Error('accessControlRecordName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}'; - requestUrl = requestUrl.replace('{accessControlRecordName}', encodeURIComponent(accessControlRecordName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['AccessControlRecord']().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); - }); -} - - -/** - * Creates or Updates an access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record. - * - * @param {object} accessControlRecord The access control record to be added or - * updated. - * - * @param {string} accessControlRecord.initiatorName The Iscsi initiator name - * (IQN) - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 AccessControlRecord} 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(accessControlRecordName, accessControlRecord, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginCreateOrUpdate(accessControlRecordName, accessControlRecord, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['AccessControlRecord']().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 the access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record to delete. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(accessControlRecordName, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginDeleteMethod(accessControlRecordName, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Creates or Updates an access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record. - * - * @param {object} accessControlRecord The access control record to be added or - * updated. - * - * @param {string} accessControlRecord.initiatorName The Iscsi initiator name - * (IQN) - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 AccessControlRecord} 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 _beginCreateOrUpdate(accessControlRecordName, accessControlRecord, resourceGroupName, managerName, 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 (accessControlRecordName === null || accessControlRecordName === undefined || typeof accessControlRecordName.valueOf() !== 'string') { - throw new Error('accessControlRecordName cannot be null or undefined and it must be of type string.'); - } - if (accessControlRecord === null || accessControlRecord === undefined) { - throw new Error('accessControlRecord cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}'; - requestUrl = requestUrl.replace('{accessControlRecordName}', encodeURIComponent(accessControlRecordName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 (accessControlRecord !== null && accessControlRecord !== undefined) { - let requestModelMapper = new client.models['AccessControlRecord']().mapper(); - requestModel = client.serialize(requestModelMapper, accessControlRecord, 'accessControlRecord'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(accessControlRecord, 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 !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['AccessControlRecord']().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 the access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record to delete. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginDeleteMethod(accessControlRecordName, resourceGroupName, managerName, 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 (accessControlRecordName === null || accessControlRecordName === undefined || typeof accessControlRecordName.valueOf() !== 'string') { - throw new Error('accessControlRecordName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/accessControlRecords/{accessControlRecordName}'; - requestUrl = requestUrl.replace('{accessControlRecordName}', encodeURIComponent(accessControlRecordName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** Class representing a AccessControlRecords. */ -class AccessControlRecords { - /** - * Create a AccessControlRecords. - * @param {StorSimpleManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listByManager = _listByManager; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._deleteMethod = _deleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - } - - /** - * Retrieves all the access control records in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByManagerWithHttpOperationResponse(resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByManager(resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the access control records in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {AccessControlRecordList} - 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 AccessControlRecordList} 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. - */ - listByManager(resourceGroupName, managerName, 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._listByManager(resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByManager(resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Returns the properties of the specified access control record name. - * - * @param {string} accessControlRecordName Name of access control record to be - * fetched. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(accessControlRecordName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(accessControlRecordName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the properties of the specified access control record name. - * - * @param {string} accessControlRecordName Name of access control record to be - * fetched. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {AccessControlRecord} - 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 AccessControlRecord} 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(accessControlRecordName, resourceGroupName, managerName, 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(accessControlRecordName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(accessControlRecordName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or Updates an access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record. - * - * @param {object} accessControlRecord The access control record to be added or - * updated. - * - * @param {string} accessControlRecord.initiatorName The Iscsi initiator name - * (IQN) - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(accessControlRecordName, accessControlRecord, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(accessControlRecordName, accessControlRecord, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or Updates an access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record. - * - * @param {object} accessControlRecord The access control record to be added or - * updated. - * - * @param {string} accessControlRecord.initiatorName The Iscsi initiator name - * (IQN) - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {AccessControlRecord} - 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 AccessControlRecord} 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(accessControlRecordName, accessControlRecord, resourceGroupName, managerName, 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(accessControlRecordName, accessControlRecord, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(accessControlRecordName, accessControlRecord, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record to delete. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(accessControlRecordName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(accessControlRecordName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record to delete. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(accessControlRecordName, resourceGroupName, managerName, 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(accessControlRecordName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(accessControlRecordName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or Updates an access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record. - * - * @param {object} accessControlRecord The access control record to be added or - * updated. - * - * @param {string} accessControlRecord.initiatorName The Iscsi initiator name - * (IQN) - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(accessControlRecordName, accessControlRecord, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(accessControlRecordName, accessControlRecord, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or Updates an access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record. - * - * @param {object} accessControlRecord The access control record to be added or - * updated. - * - * @param {string} accessControlRecord.initiatorName The Iscsi initiator name - * (IQN) - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {AccessControlRecord} - 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 AccessControlRecord} 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. - */ - beginCreateOrUpdate(accessControlRecordName, accessControlRecord, resourceGroupName, managerName, 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._beginCreateOrUpdate(accessControlRecordName, accessControlRecord, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(accessControlRecordName, accessControlRecord, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record to delete. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(accessControlRecordName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(accessControlRecordName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record to delete. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(accessControlRecordName, resourceGroupName, managerName, 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._beginDeleteMethod(accessControlRecordName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(accessControlRecordName, resourceGroupName, managerName, options, optionalCallback); - } - } - -} - -module.exports = AccessControlRecords; diff --git a/lib/services/storSimple1200Series/lib/operations/alerts.js b/lib/services/storSimple1200Series/lib/operations/alerts.js deleted file mode 100644 index b4af31ec85..0000000000 --- a/lib/services/storSimple1200Series/lib/operations/alerts.js +++ /dev/null @@ -1,1023 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * Retrieves all the alerts in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 AlertList} 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 _listByManager(resourceGroupName, managerName, 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.'); - } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - // Validate - try { - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter 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.StorSimple/managers/{managerName}/alerts'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['AlertList']().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); - }); -} - -/** - * Clear the alerts. - * - * @param {object} request The clear alert request. - * - * @param {string} [request.resolutionMessage] Resolution message while - * clearing the request - * - * @param {array} request.alerts List of alert Ids to be cleared - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _clear(request, resourceGroupName, managerName, 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 (request === null || request === undefined) { - throw new Error('request cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/clearAlerts'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 (request !== null && request !== undefined) { - let requestModelMapper = new client.models['ClearAlertRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, request, 'request'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(request, 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 !== 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** - * Sends a test alert email. - * - * @param {string} deviceName The device name. - * - * @param {object} request The send test alert email request. - * - * @param {array} request.emailList List of emails to send the test alerts - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _sendTestEmail(deviceName, request, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (request === null || request === undefined) { - throw new Error('request cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/sendTestAlertEmail'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 (request !== null && request !== undefined) { - let requestModelMapper = new client.models['SendTestAlertEmailRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, request, 'request'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(request, 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 !== 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** - * Retrieves all the alerts in a manager. - * - * @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 AlertList} 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 _listByManagerNext(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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['AlertList']().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 Alerts. */ -class Alerts { - /** - * Create a Alerts. - * @param {StorSimpleManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listByManager = _listByManager; - this._clear = _clear; - this._sendTestEmail = _sendTestEmail; - this._listByManagerNext = _listByManagerNext; - } - - /** - * Retrieves all the alerts in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listByManagerWithHttpOperationResponse(resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByManager(resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the alerts in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {AlertList} - 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 AlertList} 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. - */ - listByManager(resourceGroupName, managerName, 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._listByManager(resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByManager(resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Clear the alerts. - * - * @param {object} request The clear alert request. - * - * @param {string} [request.resolutionMessage] Resolution message while - * clearing the request - * - * @param {array} request.alerts List of alert Ids to be cleared - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - clearWithHttpOperationResponse(request, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._clear(request, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Clear the alerts. - * - * @param {object} request The clear alert request. - * - * @param {string} [request.resolutionMessage] Resolution message while - * clearing the request - * - * @param {array} request.alerts List of alert Ids to be cleared - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - clear(request, resourceGroupName, managerName, 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._clear(request, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._clear(request, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Sends a test alert email. - * - * @param {string} deviceName The device name. - * - * @param {object} request The send test alert email request. - * - * @param {array} request.emailList List of emails to send the test alerts - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - sendTestEmailWithHttpOperationResponse(deviceName, request, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._sendTestEmail(deviceName, request, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Sends a test alert email. - * - * @param {string} deviceName The device name. - * - * @param {object} request The send test alert email request. - * - * @param {array} request.emailList List of emails to send the test alerts - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - sendTestEmail(deviceName, request, resourceGroupName, managerName, 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._sendTestEmail(deviceName, request, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._sendTestEmail(deviceName, request, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Retrieves all the alerts in a manager. - * - * @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. - */ - listByManagerNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByManagerNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the alerts in a manager. - * - * @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 {AlertList} - 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 AlertList} 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. - */ - listByManagerNext(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._listByManagerNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByManagerNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = Alerts; diff --git a/lib/services/storSimple1200Series/lib/operations/availableProviderOperationsOperations.js b/lib/services/storSimple1200Series/lib/operations/availableProviderOperationsOperations.js deleted file mode 100644 index 9cd31796dd..0000000000 --- a/lib/services/storSimple1200Series/lib/operations/availableProviderOperationsOperations.js +++ /dev/null @@ -1,459 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * List of AvailableProviderOperations - * - * @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 AvailableProviderOperations} 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.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.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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.StorSimple/operations'; - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['AvailableProviderOperations']().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); - }); -} - -/** - * List of AvailableProviderOperations - * - * @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 AvailableProviderOperations} 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['AvailableProviderOperations']().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 AvailableProviderOperationsOperations. */ -class AvailableProviderOperationsOperations { - /** - * Create a AvailableProviderOperationsOperations. - * @param {StorSimpleManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._listNext = _listNext; - } - - /** - * List of AvailableProviderOperations - * - * @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; - }); - }); - } - - /** - * List of AvailableProviderOperations - * - * @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 {AvailableProviderOperations} - 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 AvailableProviderOperations} 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); - } - } - - /** - * List of AvailableProviderOperations - * - * @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; - }); - }); - } - - /** - * List of AvailableProviderOperations - * - * @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 {AvailableProviderOperations} - 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 AvailableProviderOperations} 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 = AvailableProviderOperationsOperations; diff --git a/lib/services/storSimple1200Series/lib/operations/backupScheduleGroups.js b/lib/services/storSimple1200Series/lib/operations/backupScheduleGroups.js deleted file mode 100644 index 3dbaa81f1c..0000000000 --- a/lib/services/storSimple1200Series/lib/operations/backupScheduleGroups.js +++ /dev/null @@ -1,1463 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * Retrieves all the backup schedule groups in a device. - * - * @param {string} deviceName The name of the device. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 BackupScheduleGroupList} 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 _listByDevice(deviceName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['BackupScheduleGroupList']().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); - }); -} - -/** - * Returns the properties of the specified backup schedule group name. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 BackupScheduleGroup} 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(deviceName, scheduleGroupName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (scheduleGroupName === null || scheduleGroupName === undefined || typeof scheduleGroupName.valueOf() !== 'string') { - throw new Error('scheduleGroupName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups/{scheduleGroupName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{scheduleGroupName}', encodeURIComponent(scheduleGroupName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['BackupScheduleGroup']().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); - }); -} - - -/** - * Creates or Updates the backup schedule Group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {object} scheduleGroup The schedule group to be created - * - * @param {object} scheduleGroup.startTime The start time. When this field is - * specified we will generate Default GrandFather Father Son Backup Schedules. - * - * @param {number} scheduleGroup.startTime.hour The hour. - * - * @param {number} scheduleGroup.startTime.minute The minute. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 BackupScheduleGroup} 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(deviceName, scheduleGroupName, scheduleGroup, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginCreateOrUpdate(deviceName, scheduleGroupName, scheduleGroup, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupScheduleGroup']().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 the backup schedule group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, scheduleGroupName, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginDeleteMethod(deviceName, scheduleGroupName, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Creates or Updates the backup schedule Group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {object} scheduleGroup The schedule group to be created - * - * @param {object} scheduleGroup.startTime The start time. When this field is - * specified we will generate Default GrandFather Father Son Backup Schedules. - * - * @param {number} scheduleGroup.startTime.hour The hour. - * - * @param {number} scheduleGroup.startTime.minute The minute. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 BackupScheduleGroup} 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 _beginCreateOrUpdate(deviceName, scheduleGroupName, scheduleGroup, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (scheduleGroupName === null || scheduleGroupName === undefined || typeof scheduleGroupName.valueOf() !== 'string') { - throw new Error('scheduleGroupName cannot be null or undefined and it must be of type string.'); - } - if (scheduleGroup === null || scheduleGroup === undefined) { - throw new Error('scheduleGroup cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups/{scheduleGroupName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{scheduleGroupName}', encodeURIComponent(scheduleGroupName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 (scheduleGroup !== null && scheduleGroup !== undefined) { - let requestModelMapper = new client.models['BackupScheduleGroup']().mapper(); - requestModel = client.serialize(requestModelMapper, scheduleGroup, 'scheduleGroup'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(scheduleGroup, 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 !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['BackupScheduleGroup']().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 the backup schedule group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginDeleteMethod(deviceName, scheduleGroupName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (scheduleGroupName === null || scheduleGroupName === undefined || typeof scheduleGroupName.valueOf() !== 'string') { - throw new Error('scheduleGroupName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backupScheduleGroups/{scheduleGroupName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{scheduleGroupName}', encodeURIComponent(scheduleGroupName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** Class representing a BackupScheduleGroups. */ -class BackupScheduleGroups { - /** - * Create a BackupScheduleGroups. - * @param {StorSimpleManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listByDevice = _listByDevice; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._deleteMethod = _deleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - } - - /** - * Retrieves all the backup schedule groups in a device. - * - * @param {string} deviceName The name of the device. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByDeviceWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByDevice(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the backup schedule groups in a device. - * - * @param {string} deviceName The name of the device. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {BackupScheduleGroupList} - 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 BackupScheduleGroupList} 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. - */ - listByDevice(deviceName, resourceGroupName, managerName, 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._listByDevice(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByDevice(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Returns the properties of the specified backup schedule group name. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, scheduleGroupName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(deviceName, scheduleGroupName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the properties of the specified backup schedule group name. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {BackupScheduleGroup} - 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 BackupScheduleGroup} 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(deviceName, scheduleGroupName, resourceGroupName, managerName, 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(deviceName, scheduleGroupName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(deviceName, scheduleGroupName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or Updates the backup schedule Group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {object} scheduleGroup The schedule group to be created - * - * @param {object} scheduleGroup.startTime The start time. When this field is - * specified we will generate Default GrandFather Father Son Backup Schedules. - * - * @param {number} scheduleGroup.startTime.hour The hour. - * - * @param {number} scheduleGroup.startTime.minute The minute. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, scheduleGroupName, scheduleGroup, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(deviceName, scheduleGroupName, scheduleGroup, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or Updates the backup schedule Group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {object} scheduleGroup The schedule group to be created - * - * @param {object} scheduleGroup.startTime The start time. When this field is - * specified we will generate Default GrandFather Father Son Backup Schedules. - * - * @param {number} scheduleGroup.startTime.hour The hour. - * - * @param {number} scheduleGroup.startTime.minute The minute. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {BackupScheduleGroup} - 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 BackupScheduleGroup} 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(deviceName, scheduleGroupName, scheduleGroup, resourceGroupName, managerName, 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(deviceName, scheduleGroupName, scheduleGroup, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(deviceName, scheduleGroupName, scheduleGroup, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the backup schedule group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, scheduleGroupName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(deviceName, scheduleGroupName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the backup schedule group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, scheduleGroupName, resourceGroupName, managerName, 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(deviceName, scheduleGroupName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(deviceName, scheduleGroupName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or Updates the backup schedule Group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {object} scheduleGroup The schedule group to be created - * - * @param {object} scheduleGroup.startTime The start time. When this field is - * specified we will generate Default GrandFather Father Son Backup Schedules. - * - * @param {number} scheduleGroup.startTime.hour The hour. - * - * @param {number} scheduleGroup.startTime.minute The minute. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(deviceName, scheduleGroupName, scheduleGroup, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(deviceName, scheduleGroupName, scheduleGroup, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or Updates the backup schedule Group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {object} scheduleGroup The schedule group to be created - * - * @param {object} scheduleGroup.startTime The start time. When this field is - * specified we will generate Default GrandFather Father Son Backup Schedules. - * - * @param {number} scheduleGroup.startTime.hour The hour. - * - * @param {number} scheduleGroup.startTime.minute The minute. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {BackupScheduleGroup} - 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 BackupScheduleGroup} 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. - */ - beginCreateOrUpdate(deviceName, scheduleGroupName, scheduleGroup, resourceGroupName, managerName, 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._beginCreateOrUpdate(deviceName, scheduleGroupName, scheduleGroup, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(deviceName, scheduleGroupName, scheduleGroup, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the backup schedule group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(deviceName, scheduleGroupName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(deviceName, scheduleGroupName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the backup schedule group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(deviceName, scheduleGroupName, resourceGroupName, managerName, 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._beginDeleteMethod(deviceName, scheduleGroupName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(deviceName, scheduleGroupName, resourceGroupName, managerName, options, optionalCallback); - } - } - -} - -module.exports = BackupScheduleGroups; diff --git a/lib/services/storSimple1200Series/lib/operations/backups.js b/lib/services/storSimple1200Series/lib/operations/backups.js deleted file mode 100644 index 850839e368..0000000000 --- a/lib/services/storSimple1200Series/lib/operations/backups.js +++ /dev/null @@ -1,2142 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * Retrieves all the backups in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 BackupList} 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 _listByManager(resourceGroupName, managerName, 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.'); - } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - // Validate - try { - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter 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.StorSimple/managers/{managerName}/backups'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['BackupList']().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); - }); -} - -/** - * Retrieves all the backups in a device. Can be used to get the backups for - * failover also. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.forFailover] Set to true if you need backups which - * can be used for failover. - * - * @param {string} [options.filter] OData Filter options - * - * @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 BackupList} 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 _listByDevice(deviceName, resourceGroupName, managerName, 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.'); - } - let forFailover = (options && options.forFailover !== undefined) ? options.forFailover : undefined; - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - // Validate - try { - if (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (forFailover !== null && forFailover !== undefined && typeof forFailover !== 'boolean') { - throw new Error('forFailover must be of type boolean.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter 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.StorSimple/managers/{managerName}/devices/{deviceName}/backups'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - let queryParameters = []; - if (forFailover !== null && forFailover !== undefined) { - queryParameters.push('forFailover=' + encodeURIComponent(forFailover.toString())); - } - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['BackupList']().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 the backup. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, backupName, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginDeleteMethod(deviceName, backupName, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Clones the given backup element to a new disk or share with given details. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} elementName The backup element name. - * - * @param {object} cloneRequest The clone request. - * - * @param {string} cloneRequest.targetDeviceId DeviceId of the device which - * will act as the Clone target - * - * @param {string} cloneRequest.targetAccessPointId Accesspoint Id on which - * clone job will performed. - * - * @param {string} cloneRequest.newEndpointName Name of new endpoint which will - * created as part of clone job. - * - * @param {object} [cloneRequest.share] Share Object. - * - * @param {string} [cloneRequest.share.description] Description for file share - * - * @param {string} cloneRequest.share.shareStatus The Share Status. Possible - * values include: 'Online', 'Offline' - * - * @param {string} cloneRequest.share.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} cloneRequest.share.adminUser The user/group who will have - * full permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} cloneRequest.share.provisionedCapacityInBytes The total - * provisioned capacity in Bytes - * - * @param {string} cloneRequest.share.monitoringStatus The monitoring status. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [cloneRequest.disk] Disk Object - * - * @param {string} [cloneRequest.disk.description] The description. - * - * @param {string} cloneRequest.disk.diskStatus The disk status. Possible - * values include: 'Online', 'Offline' - * - * @param {array} cloneRequest.disk.accessControlRecords The access control - * records. - * - * @param {string} cloneRequest.disk.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} cloneRequest.disk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} cloneRequest.disk.monitoringStatus The monitoring. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _clone(deviceName, backupName, elementName, cloneRequest, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginClone(deviceName, backupName, elementName, cloneRequest, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Deletes the backup. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginDeleteMethod(deviceName, backupName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (backupName === null || backupName === undefined || typeof backupName.valueOf() !== 'string') { - throw new Error('backupName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{backupName}', encodeURIComponent(backupName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** - * Clones the given backup element to a new disk or share with given details. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} elementName The backup element name. - * - * @param {object} cloneRequest The clone request. - * - * @param {string} cloneRequest.targetDeviceId DeviceId of the device which - * will act as the Clone target - * - * @param {string} cloneRequest.targetAccessPointId Accesspoint Id on which - * clone job will performed. - * - * @param {string} cloneRequest.newEndpointName Name of new endpoint which will - * created as part of clone job. - * - * @param {object} [cloneRequest.share] Share Object. - * - * @param {string} [cloneRequest.share.description] Description for file share - * - * @param {string} cloneRequest.share.shareStatus The Share Status. Possible - * values include: 'Online', 'Offline' - * - * @param {string} cloneRequest.share.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} cloneRequest.share.adminUser The user/group who will have - * full permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} cloneRequest.share.provisionedCapacityInBytes The total - * provisioned capacity in Bytes - * - * @param {string} cloneRequest.share.monitoringStatus The monitoring status. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [cloneRequest.disk] Disk Object - * - * @param {string} [cloneRequest.disk.description] The description. - * - * @param {string} cloneRequest.disk.diskStatus The disk status. Possible - * values include: 'Online', 'Offline' - * - * @param {array} cloneRequest.disk.accessControlRecords The access control - * records. - * - * @param {string} cloneRequest.disk.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} cloneRequest.disk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} cloneRequest.disk.monitoringStatus The monitoring. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginClone(deviceName, backupName, elementName, cloneRequest, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (backupName === null || backupName === undefined || typeof backupName.valueOf() !== 'string') { - throw new Error('backupName cannot be null or undefined and it must be of type string.'); - } - if (elementName === null || elementName === undefined || typeof elementName.valueOf() !== 'string') { - throw new Error('elementName cannot be null or undefined and it must be of type string.'); - } - if (cloneRequest === null || cloneRequest === undefined) { - throw new Error('cloneRequest cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/backups/{backupName}/elements/{elementName}/clone'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{backupName}', encodeURIComponent(backupName)); - requestUrl = requestUrl.replace('{elementName}', encodeURIComponent(elementName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 (cloneRequest !== null && cloneRequest !== undefined) { - let requestModelMapper = new client.models['CloneRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, cloneRequest, 'cloneRequest'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(cloneRequest, 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 !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** - * Retrieves all the backups in a manager. - * - * @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 BackupList} 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 _listByManagerNext(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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['BackupList']().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); - }); -} - -/** - * Retrieves all the backups in a device. Can be used to get the backups for - * failover also. - * - * @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 BackupList} 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 _listByDeviceNext(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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['BackupList']().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 Backups. */ -class Backups { - /** - * Create a Backups. - * @param {StorSimpleManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listByManager = _listByManager; - this._listByDevice = _listByDevice; - this._deleteMethod = _deleteMethod; - this._clone = _clone; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginClone = _beginClone; - this._listByManagerNext = _listByManagerNext; - this._listByDeviceNext = _listByDeviceNext; - } - - /** - * Retrieves all the backups in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listByManagerWithHttpOperationResponse(resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByManager(resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the backups in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {BackupList} - 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 BackupList} 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. - */ - listByManager(resourceGroupName, managerName, 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._listByManager(resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByManager(resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Retrieves all the backups in a device. Can be used to get the backups for - * failover also. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.forFailover] Set to true if you need backups which - * can be used for failover. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listByDeviceWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByDevice(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the backups in a device. Can be used to get the backups for - * failover also. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.forFailover] Set to true if you need backups which - * can be used for failover. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {BackupList} - 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 BackupList} 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. - */ - listByDevice(deviceName, resourceGroupName, managerName, 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._listByDevice(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByDevice(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the backup. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, backupName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(deviceName, backupName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the backup. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, backupName, resourceGroupName, managerName, 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(deviceName, backupName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(deviceName, backupName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Clones the given backup element to a new disk or share with given details. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} elementName The backup element name. - * - * @param {object} cloneRequest The clone request. - * - * @param {string} cloneRequest.targetDeviceId DeviceId of the device which - * will act as the Clone target - * - * @param {string} cloneRequest.targetAccessPointId Accesspoint Id on which - * clone job will performed. - * - * @param {string} cloneRequest.newEndpointName Name of new endpoint which will - * created as part of clone job. - * - * @param {object} [cloneRequest.share] Share Object. - * - * @param {string} [cloneRequest.share.description] Description for file share - * - * @param {string} cloneRequest.share.shareStatus The Share Status. Possible - * values include: 'Online', 'Offline' - * - * @param {string} cloneRequest.share.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} cloneRequest.share.adminUser The user/group who will have - * full permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} cloneRequest.share.provisionedCapacityInBytes The total - * provisioned capacity in Bytes - * - * @param {string} cloneRequest.share.monitoringStatus The monitoring status. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [cloneRequest.disk] Disk Object - * - * @param {string} [cloneRequest.disk.description] The description. - * - * @param {string} cloneRequest.disk.diskStatus The disk status. Possible - * values include: 'Online', 'Offline' - * - * @param {array} cloneRequest.disk.accessControlRecords The access control - * records. - * - * @param {string} cloneRequest.disk.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} cloneRequest.disk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} cloneRequest.disk.monitoringStatus The monitoring. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - cloneWithHttpOperationResponse(deviceName, backupName, elementName, cloneRequest, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._clone(deviceName, backupName, elementName, cloneRequest, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Clones the given backup element to a new disk or share with given details. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} elementName The backup element name. - * - * @param {object} cloneRequest The clone request. - * - * @param {string} cloneRequest.targetDeviceId DeviceId of the device which - * will act as the Clone target - * - * @param {string} cloneRequest.targetAccessPointId Accesspoint Id on which - * clone job will performed. - * - * @param {string} cloneRequest.newEndpointName Name of new endpoint which will - * created as part of clone job. - * - * @param {object} [cloneRequest.share] Share Object. - * - * @param {string} [cloneRequest.share.description] Description for file share - * - * @param {string} cloneRequest.share.shareStatus The Share Status. Possible - * values include: 'Online', 'Offline' - * - * @param {string} cloneRequest.share.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} cloneRequest.share.adminUser The user/group who will have - * full permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} cloneRequest.share.provisionedCapacityInBytes The total - * provisioned capacity in Bytes - * - * @param {string} cloneRequest.share.monitoringStatus The monitoring status. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [cloneRequest.disk] Disk Object - * - * @param {string} [cloneRequest.disk.description] The description. - * - * @param {string} cloneRequest.disk.diskStatus The disk status. Possible - * values include: 'Online', 'Offline' - * - * @param {array} cloneRequest.disk.accessControlRecords The access control - * records. - * - * @param {string} cloneRequest.disk.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} cloneRequest.disk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} cloneRequest.disk.monitoringStatus The monitoring. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - clone(deviceName, backupName, elementName, cloneRequest, resourceGroupName, managerName, 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._clone(deviceName, backupName, elementName, cloneRequest, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._clone(deviceName, backupName, elementName, cloneRequest, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the backup. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(deviceName, backupName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(deviceName, backupName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the backup. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(deviceName, backupName, resourceGroupName, managerName, 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._beginDeleteMethod(deviceName, backupName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(deviceName, backupName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Clones the given backup element to a new disk or share with given details. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} elementName The backup element name. - * - * @param {object} cloneRequest The clone request. - * - * @param {string} cloneRequest.targetDeviceId DeviceId of the device which - * will act as the Clone target - * - * @param {string} cloneRequest.targetAccessPointId Accesspoint Id on which - * clone job will performed. - * - * @param {string} cloneRequest.newEndpointName Name of new endpoint which will - * created as part of clone job. - * - * @param {object} [cloneRequest.share] Share Object. - * - * @param {string} [cloneRequest.share.description] Description for file share - * - * @param {string} cloneRequest.share.shareStatus The Share Status. Possible - * values include: 'Online', 'Offline' - * - * @param {string} cloneRequest.share.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} cloneRequest.share.adminUser The user/group who will have - * full permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} cloneRequest.share.provisionedCapacityInBytes The total - * provisioned capacity in Bytes - * - * @param {string} cloneRequest.share.monitoringStatus The monitoring status. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [cloneRequest.disk] Disk Object - * - * @param {string} [cloneRequest.disk.description] The description. - * - * @param {string} cloneRequest.disk.diskStatus The disk status. Possible - * values include: 'Online', 'Offline' - * - * @param {array} cloneRequest.disk.accessControlRecords The access control - * records. - * - * @param {string} cloneRequest.disk.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} cloneRequest.disk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} cloneRequest.disk.monitoringStatus The monitoring. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCloneWithHttpOperationResponse(deviceName, backupName, elementName, cloneRequest, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginClone(deviceName, backupName, elementName, cloneRequest, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Clones the given backup element to a new disk or share with given details. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} elementName The backup element name. - * - * @param {object} cloneRequest The clone request. - * - * @param {string} cloneRequest.targetDeviceId DeviceId of the device which - * will act as the Clone target - * - * @param {string} cloneRequest.targetAccessPointId Accesspoint Id on which - * clone job will performed. - * - * @param {string} cloneRequest.newEndpointName Name of new endpoint which will - * created as part of clone job. - * - * @param {object} [cloneRequest.share] Share Object. - * - * @param {string} [cloneRequest.share.description] Description for file share - * - * @param {string} cloneRequest.share.shareStatus The Share Status. Possible - * values include: 'Online', 'Offline' - * - * @param {string} cloneRequest.share.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} cloneRequest.share.adminUser The user/group who will have - * full permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} cloneRequest.share.provisionedCapacityInBytes The total - * provisioned capacity in Bytes - * - * @param {string} cloneRequest.share.monitoringStatus The monitoring status. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [cloneRequest.disk] Disk Object - * - * @param {string} [cloneRequest.disk.description] The description. - * - * @param {string} cloneRequest.disk.diskStatus The disk status. Possible - * values include: 'Online', 'Offline' - * - * @param {array} cloneRequest.disk.accessControlRecords The access control - * records. - * - * @param {string} cloneRequest.disk.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} cloneRequest.disk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} cloneRequest.disk.monitoringStatus The monitoring. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginClone(deviceName, backupName, elementName, cloneRequest, resourceGroupName, managerName, 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._beginClone(deviceName, backupName, elementName, cloneRequest, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginClone(deviceName, backupName, elementName, cloneRequest, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Retrieves all the backups in a manager. - * - * @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. - */ - listByManagerNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByManagerNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the backups in a manager. - * - * @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 {BackupList} - 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 BackupList} 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. - */ - listByManagerNext(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._listByManagerNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByManagerNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Retrieves all the backups in a device. Can be used to get the backups for - * failover also. - * - * @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. - */ - listByDeviceNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByDeviceNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the backups in a device. Can be used to get the backups for - * failover also. - * - * @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 {BackupList} - 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 BackupList} 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. - */ - listByDeviceNext(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._listByDeviceNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByDeviceNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = Backups; diff --git a/lib/services/storSimple1200Series/lib/operations/chapSettingsOperations.js b/lib/services/storSimple1200Series/lib/operations/chapSettingsOperations.js deleted file mode 100644 index 0335d0e000..0000000000 --- a/lib/services/storSimple1200Series/lib/operations/chapSettingsOperations.js +++ /dev/null @@ -1,1497 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * Retrieves all the chap settings in a device. - * - * @param {string} deviceName The name of the device. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 ChapSettingsList} 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 _listByDevice(deviceName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ChapSettingsList']().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); - }); -} - -/** - * Returns the properties of the specified chap setting name. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The user name of chap to be fetched. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 ChapSettings} 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(deviceName, chapUserName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (chapUserName === null || chapUserName === undefined || typeof chapUserName.valueOf() !== 'string') { - throw new Error('chapUserName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings/{chapUserName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{chapUserName}', encodeURIComponent(chapUserName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ChapSettings']().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); - }); -} - - -/** - * Creates or updates the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {object} chapSetting The chap setting to be added or updated. - * - * @param {object} chapSetting.password The chap password. - * - * @param {string} chapSetting.password.value The value of the secret itself. - * If the secret is in plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. - * - * @param {string} [chapSetting.password.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} chapSetting.password.encryptionAlgorithm Algorithm used to - * encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 ChapSettings} 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(deviceName, chapUserName, chapSetting, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginCreateOrUpdate(deviceName, chapUserName, chapSetting, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ChapSettings']().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 the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, chapUserName, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginDeleteMethod(deviceName, chapUserName, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Creates or updates the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {object} chapSetting The chap setting to be added or updated. - * - * @param {object} chapSetting.password The chap password. - * - * @param {string} chapSetting.password.value The value of the secret itself. - * If the secret is in plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. - * - * @param {string} [chapSetting.password.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} chapSetting.password.encryptionAlgorithm Algorithm used to - * encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 ChapSettings} 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 _beginCreateOrUpdate(deviceName, chapUserName, chapSetting, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (chapUserName === null || chapUserName === undefined || typeof chapUserName.valueOf() !== 'string') { - throw new Error('chapUserName cannot be null or undefined and it must be of type string.'); - } - if (chapSetting === null || chapSetting === undefined) { - throw new Error('chapSetting cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings/{chapUserName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{chapUserName}', encodeURIComponent(chapUserName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 (chapSetting !== null && chapSetting !== undefined) { - let requestModelMapper = new client.models['ChapSettings']().mapper(); - requestModel = client.serialize(requestModelMapper, chapSetting, 'chapSetting'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(chapSetting, 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 !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ChapSettings']().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 the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginDeleteMethod(deviceName, chapUserName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (chapUserName === null || chapUserName === undefined || typeof chapUserName.valueOf() !== 'string') { - throw new Error('chapUserName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/chapSettings/{chapUserName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{chapUserName}', encodeURIComponent(chapUserName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** Class representing a ChapSettingsOperations. */ -class ChapSettingsOperations { - /** - * Create a ChapSettingsOperations. - * @param {StorSimpleManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listByDevice = _listByDevice; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._deleteMethod = _deleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - } - - /** - * Retrieves all the chap settings in a device. - * - * @param {string} deviceName The name of the device. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByDeviceWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByDevice(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the chap settings in a device. - * - * @param {string} deviceName The name of the device. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ChapSettingsList} - 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 ChapSettingsList} 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. - */ - listByDevice(deviceName, resourceGroupName, managerName, 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._listByDevice(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByDevice(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Returns the properties of the specified chap setting name. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The user name of chap to be fetched. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, chapUserName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(deviceName, chapUserName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the properties of the specified chap setting name. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The user name of chap to be fetched. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ChapSettings} - 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 ChapSettings} 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(deviceName, chapUserName, resourceGroupName, managerName, 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(deviceName, chapUserName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(deviceName, chapUserName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {object} chapSetting The chap setting to be added or updated. - * - * @param {object} chapSetting.password The chap password. - * - * @param {string} chapSetting.password.value The value of the secret itself. - * If the secret is in plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. - * - * @param {string} [chapSetting.password.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} chapSetting.password.encryptionAlgorithm Algorithm used to - * encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, chapUserName, chapSetting, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(deviceName, chapUserName, chapSetting, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {object} chapSetting The chap setting to be added or updated. - * - * @param {object} chapSetting.password The chap password. - * - * @param {string} chapSetting.password.value The value of the secret itself. - * If the secret is in plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. - * - * @param {string} [chapSetting.password.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} chapSetting.password.encryptionAlgorithm Algorithm used to - * encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ChapSettings} - 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 ChapSettings} 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(deviceName, chapUserName, chapSetting, resourceGroupName, managerName, 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(deviceName, chapUserName, chapSetting, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(deviceName, chapUserName, chapSetting, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, chapUserName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(deviceName, chapUserName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, chapUserName, resourceGroupName, managerName, 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(deviceName, chapUserName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(deviceName, chapUserName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {object} chapSetting The chap setting to be added or updated. - * - * @param {object} chapSetting.password The chap password. - * - * @param {string} chapSetting.password.value The value of the secret itself. - * If the secret is in plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. - * - * @param {string} [chapSetting.password.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} chapSetting.password.encryptionAlgorithm Algorithm used to - * encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(deviceName, chapUserName, chapSetting, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(deviceName, chapUserName, chapSetting, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {object} chapSetting The chap setting to be added or updated. - * - * @param {object} chapSetting.password The chap password. - * - * @param {string} chapSetting.password.value The value of the secret itself. - * If the secret is in plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. - * - * @param {string} [chapSetting.password.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} chapSetting.password.encryptionAlgorithm Algorithm used to - * encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ChapSettings} - 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 ChapSettings} 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. - */ - beginCreateOrUpdate(deviceName, chapUserName, chapSetting, resourceGroupName, managerName, 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._beginCreateOrUpdate(deviceName, chapUserName, chapSetting, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(deviceName, chapUserName, chapSetting, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(deviceName, chapUserName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(deviceName, chapUserName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(deviceName, chapUserName, resourceGroupName, managerName, 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._beginDeleteMethod(deviceName, chapUserName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(deviceName, chapUserName, resourceGroupName, managerName, options, optionalCallback); - } - } - -} - -module.exports = ChapSettingsOperations; diff --git a/lib/services/storSimple1200Series/lib/operations/devices.js b/lib/services/storSimple1200Series/lib/operations/devices.js deleted file mode 100644 index 451ef271be..0000000000 --- a/lib/services/storSimple1200Series/lib/operations/devices.js +++ /dev/null @@ -1,6317 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * Retrieves all the devices in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Specify $expand=details to populate - * additional fields related to the device. - * - * @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 DeviceList} 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 _listByManager(resourceGroupName, managerName, 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.'); - } - let expand = (options && options.expand !== undefined) ? options.expand : undefined; - // Validate - try { - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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.StorSimple/managers/{managerName}/devices'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['DeviceList']().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); - }); -} - -/** - * Returns the properties of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Specify $expand=details to populate - * additional fields related to the device. - * - * @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 Device} 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(deviceName, resourceGroupName, managerName, 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.'); - } - let expand = (options && options.expand !== undefined) ? options.expand : undefined; - // Validate - try { - if (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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.StorSimple/managers/{managerName}/devices/{deviceName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['Device']().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 the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginDeleteMethod(deviceName, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Patches the device. - * - * @param {string} deviceName The device Name. - * - * @param {object} devicePatch Patch representation of the device. - * - * @param {string} [devicePatch.deviceDescription] Short description given for - * the device - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 Device} 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 _patch(deviceName, devicePatch, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginPatch(deviceName, devicePatch, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Device']().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); - }); - }); -} - -/** - * Returns the alert settings of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 AlertSettings} 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 _getAlertSettings(deviceName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/alertSettings/default'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['AlertSettings']().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); - }); -} - - -/** - * Creates or updates the alert settings - * - * @param {string} deviceName The device name. - * - * @param {object} alertSettings The alert settings. - * - * @param {string} alertSettings.emailNotification Value indicating whether - * user/admins will receive emails when an alert condition occurs on the - * system. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.notificationToServiceOwners Value indicating - * whether service owners will receive emails when an alert condition occurs on - * the system. Applicable only if emailNotification flag is Enabled. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.alertNotificationCulture Culture setting to be - * used while building alert emails. For eg: "en-US" - * - * @param {array} [alertSettings.additionalRecipientEmailList] List of email - * addresses (apart from admin/coadmin of subscription) to whom the alert - * emails need to be sent - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 AlertSettings} 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 _createOrUpdateAlertSettings(deviceName, alertSettings, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginCreateOrUpdateAlertSettings(deviceName, alertSettings, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['AlertSettings']().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); - }); - }); -} - - -/** - * Deactivates the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _deactivate(deviceName, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginDeactivate(deviceName, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Downloads udpates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _downloadUpdates(deviceName, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginDownloadUpdates(deviceName, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Fails over the device to another device. - * - * @param {string} deviceName The device name. - * - * @param {object} failoverRequest The failover request. - * - * @param {array} [failoverRequest.accesspointIds] - * - * @param {string} [failoverRequest.targetDeviceId] - * - * @param {boolean} [failoverRequest.skipValidation] - * - * @param {boolean} [failoverRequest.keepSourceDevice] - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _failover(deviceName, failoverRequest, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginFailover(deviceName, failoverRequest, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Retrieves all the devices which can be used as failover targets for the - * given device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Specify $expand=details to populate - * additional fields related to the device. - * - * @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 DeviceList} 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 _listFailoverTarget(deviceName, resourceGroupName, managerName, 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.'); - } - let expand = (options && options.expand !== undefined) ? options.expand : undefined; - // Validate - try { - if (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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 (expand !== null && expand !== undefined && typeof expand.valueOf() !== 'string') { - throw new Error('expand 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.StorSimple/managers/{managerName}/devices/{deviceName}/failoverTargets'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (expand !== null && expand !== undefined) { - queryParameters.push('$expand=' + encodeURIComponent(expand)); - } - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['DeviceList']().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); - }); -} - - -/** - * Installs the updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _installUpdates(deviceName, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginInstallUpdates(deviceName, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Retrieves the device metrics. - * - * @param {string} deviceName The name of the appliance. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 MetricList} 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 _listMetrics(deviceName, resourceGroupName, managerName, 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.'); - } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - // Validate - try { - if (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter 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.StorSimple/managers/{managerName}/devices/{deviceName}/metrics'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['MetricList']().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); - }); -} - -/** - * Retrieves metric definition of all metrics aggregated at device. - * - * @param {string} deviceName The name of the appliance. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 MetricDefinitionList} 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 _listMetricDefinition(deviceName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/metricsDefinitions'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['MetricDefinitionList']().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); - }); -} - -/** - * Returns the network settings of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 NetworkSettings} 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 _getNetworkSettings(deviceName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/networkSettings/default'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['NetworkSettings']().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); - }); -} - - -/** - * Scans for updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _scanForUpdates(deviceName, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginScanForUpdates(deviceName, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Creates or updates the security settings. - * - * @param {string} deviceName The device name. - * - * @param {object} securitySettings The security settings. - * - * @param {object} securitySettings.deviceAdminPassword Device administrator - * password as an encrypted string (encrypted using RSA PKCS #1) is used to log - * into the local web UI of the device. Actual password could have at least 8 - * characters that are a combination of uppercase, lowercase, numeric, and - * special characters - * - * @param {string} securitySettings.deviceAdminPassword.value The value of the - * secret itself. If the secret is in plaintext then EncryptionAlgorithm will - * be none and EncryptionCertThumbprint will be null. - * - * @param {string} - * [securitySettings.deviceAdminPassword.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} securitySettings.deviceAdminPassword.encryptionAlgorithm - * Algorithm used to encrypt "Value". Possible values include: 'None', - * 'AES256', 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _createOrUpdateSecuritySettings(deviceName, securitySettings, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginCreateOrUpdateSecuritySettings(deviceName, securitySettings, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Returns the time settings of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 TimeSettings} 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 _getTimeSettings(deviceName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/timeSettings/default'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['TimeSettings']().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); - }); -} - -/** - * Returns the update summary of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 Updates} 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 _getUpdateSummary(deviceName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/updateSummary/default'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['Updates']().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 the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginDeleteMethod(deviceName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** - * Patches the device. - * - * @param {string} deviceName The device Name. - * - * @param {object} devicePatch Patch representation of the device. - * - * @param {string} [devicePatch.deviceDescription] Short description given for - * the device - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 Device} 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 _beginPatch(deviceName, devicePatch, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (devicePatch === null || devicePatch === undefined) { - throw new Error('devicePatch cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 = 'PATCH'; - 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 (devicePatch !== null && devicePatch !== undefined) { - let requestModelMapper = new client.models['DevicePatch']().mapper(); - requestModel = client.serialize(requestModelMapper, devicePatch, 'devicePatch'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(devicePatch, 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 !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['Device']().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); - }); -} - -/** - * Creates or updates the alert settings - * - * @param {string} deviceName The device name. - * - * @param {object} alertSettings The alert settings. - * - * @param {string} alertSettings.emailNotification Value indicating whether - * user/admins will receive emails when an alert condition occurs on the - * system. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.notificationToServiceOwners Value indicating - * whether service owners will receive emails when an alert condition occurs on - * the system. Applicable only if emailNotification flag is Enabled. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.alertNotificationCulture Culture setting to be - * used while building alert emails. For eg: "en-US" - * - * @param {array} [alertSettings.additionalRecipientEmailList] List of email - * addresses (apart from admin/coadmin of subscription) to whom the alert - * emails need to be sent - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 AlertSettings} 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 _beginCreateOrUpdateAlertSettings(deviceName, alertSettings, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (alertSettings === null || alertSettings === undefined) { - throw new Error('alertSettings cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/alertSettings/default'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 (alertSettings !== null && alertSettings !== undefined) { - let requestModelMapper = new client.models['AlertSettings']().mapper(); - requestModel = client.serialize(requestModelMapper, alertSettings, 'alertSettings'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(alertSettings, 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 !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['AlertSettings']().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); - }); -} - -/** - * Deactivates the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginDeactivate(deviceName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/deactivate'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** - * Downloads udpates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginDownloadUpdates(deviceName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/download'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** - * Fails over the device to another device. - * - * @param {string} deviceName The device name. - * - * @param {object} failoverRequest The failover request. - * - * @param {array} [failoverRequest.accesspointIds] - * - * @param {string} [failoverRequest.targetDeviceId] - * - * @param {boolean} [failoverRequest.skipValidation] - * - * @param {boolean} [failoverRequest.keepSourceDevice] - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginFailover(deviceName, failoverRequest, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (failoverRequest === null || failoverRequest === undefined) { - throw new Error('failoverRequest cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/failover'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 (failoverRequest !== null && failoverRequest !== undefined) { - let requestModelMapper = new client.models['FailoverRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, failoverRequest, 'failoverRequest'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(failoverRequest, 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 !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** - * Installs the updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginInstallUpdates(deviceName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/install'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** - * Scans for updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginScanForUpdates(deviceName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/scanForUpdates'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** - * Creates or updates the security settings. - * - * @param {string} deviceName The device name. - * - * @param {object} securitySettings The security settings. - * - * @param {object} securitySettings.deviceAdminPassword Device administrator - * password as an encrypted string (encrypted using RSA PKCS #1) is used to log - * into the local web UI of the device. Actual password could have at least 8 - * characters that are a combination of uppercase, lowercase, numeric, and - * special characters - * - * @param {string} securitySettings.deviceAdminPassword.value The value of the - * secret itself. If the secret is in plaintext then EncryptionAlgorithm will - * be none and EncryptionCertThumbprint will be null. - * - * @param {string} - * [securitySettings.deviceAdminPassword.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} securitySettings.deviceAdminPassword.encryptionAlgorithm - * Algorithm used to encrypt "Value". Possible values include: 'None', - * 'AES256', 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginCreateOrUpdateSecuritySettings(deviceName, securitySettings, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (securitySettings === null || securitySettings === undefined) { - throw new Error('securitySettings cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/securitySettings/default/update'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 (securitySettings !== null && securitySettings !== undefined) { - let requestModelMapper = new client.models['SecuritySettings']().mapper(); - requestModel = client.serialize(requestModelMapper, securitySettings, 'securitySettings'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(securitySettings, 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 !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** Class representing a Devices. */ -class Devices { - /** - * Create a Devices. - * @param {StorSimpleManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listByManager = _listByManager; - this._get = _get; - this._deleteMethod = _deleteMethod; - this._patch = _patch; - this._getAlertSettings = _getAlertSettings; - this._createOrUpdateAlertSettings = _createOrUpdateAlertSettings; - this._deactivate = _deactivate; - this._downloadUpdates = _downloadUpdates; - this._failover = _failover; - this._listFailoverTarget = _listFailoverTarget; - this._installUpdates = _installUpdates; - this._listMetrics = _listMetrics; - this._listMetricDefinition = _listMetricDefinition; - this._getNetworkSettings = _getNetworkSettings; - this._scanForUpdates = _scanForUpdates; - this._createOrUpdateSecuritySettings = _createOrUpdateSecuritySettings; - this._getTimeSettings = _getTimeSettings; - this._getUpdateSummary = _getUpdateSummary; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginPatch = _beginPatch; - this._beginCreateOrUpdateAlertSettings = _beginCreateOrUpdateAlertSettings; - this._beginDeactivate = _beginDeactivate; - this._beginDownloadUpdates = _beginDownloadUpdates; - this._beginFailover = _beginFailover; - this._beginInstallUpdates = _beginInstallUpdates; - this._beginScanForUpdates = _beginScanForUpdates; - this._beginCreateOrUpdateSecuritySettings = _beginCreateOrUpdateSecuritySettings; - } - - /** - * Retrieves all the devices in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Specify $expand=details to populate - * additional fields related to the device. - * - * @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. - */ - listByManagerWithHttpOperationResponse(resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByManager(resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the devices in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Specify $expand=details to populate - * additional fields related to the device. - * - * @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 {DeviceList} - 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 DeviceList} 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. - */ - listByManager(resourceGroupName, managerName, 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._listByManager(resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByManager(resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Returns the properties of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Specify $expand=details to populate - * additional fields related to the device. - * - * @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(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the properties of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Specify $expand=details to populate - * additional fields related to the device. - * - * @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 {Device} - 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 Device} 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(deviceName, resourceGroupName, managerName, 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(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, resourceGroupName, managerName, 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(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Patches the device. - * - * @param {string} deviceName The device Name. - * - * @param {object} devicePatch Patch representation of the device. - * - * @param {string} [devicePatch.deviceDescription] Short description given for - * the device - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - patchWithHttpOperationResponse(deviceName, devicePatch, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._patch(deviceName, devicePatch, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Patches the device. - * - * @param {string} deviceName The device Name. - * - * @param {object} devicePatch Patch representation of the device. - * - * @param {string} [devicePatch.deviceDescription] Short description given for - * the device - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {Device} - 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 Device} 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. - */ - patch(deviceName, devicePatch, resourceGroupName, managerName, 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._patch(deviceName, devicePatch, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._patch(deviceName, devicePatch, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Returns the alert settings of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - getAlertSettingsWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getAlertSettings(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the alert settings of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {AlertSettings} - 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 AlertSettings} 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. - */ - getAlertSettings(deviceName, resourceGroupName, managerName, 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._getAlertSettings(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getAlertSettings(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the alert settings - * - * @param {string} deviceName The device name. - * - * @param {object} alertSettings The alert settings. - * - * @param {string} alertSettings.emailNotification Value indicating whether - * user/admins will receive emails when an alert condition occurs on the - * system. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.notificationToServiceOwners Value indicating - * whether service owners will receive emails when an alert condition occurs on - * the system. Applicable only if emailNotification flag is Enabled. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.alertNotificationCulture Culture setting to be - * used while building alert emails. For eg: "en-US" - * - * @param {array} [alertSettings.additionalRecipientEmailList] List of email - * addresses (apart from admin/coadmin of subscription) to whom the alert - * emails need to be sent - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - createOrUpdateAlertSettingsWithHttpOperationResponse(deviceName, alertSettings, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdateAlertSettings(deviceName, alertSettings, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the alert settings - * - * @param {string} deviceName The device name. - * - * @param {object} alertSettings The alert settings. - * - * @param {string} alertSettings.emailNotification Value indicating whether - * user/admins will receive emails when an alert condition occurs on the - * system. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.notificationToServiceOwners Value indicating - * whether service owners will receive emails when an alert condition occurs on - * the system. Applicable only if emailNotification flag is Enabled. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.alertNotificationCulture Culture setting to be - * used while building alert emails. For eg: "en-US" - * - * @param {array} [alertSettings.additionalRecipientEmailList] List of email - * addresses (apart from admin/coadmin of subscription) to whom the alert - * emails need to be sent - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {AlertSettings} - 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 AlertSettings} 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. - */ - createOrUpdateAlertSettings(deviceName, alertSettings, resourceGroupName, managerName, 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._createOrUpdateAlertSettings(deviceName, alertSettings, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdateAlertSettings(deviceName, alertSettings, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deactivates the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - deactivateWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deactivate(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deactivates the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - deactivate(deviceName, resourceGroupName, managerName, 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._deactivate(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deactivate(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Downloads udpates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - downloadUpdatesWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._downloadUpdates(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Downloads udpates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - downloadUpdates(deviceName, resourceGroupName, managerName, 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._downloadUpdates(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._downloadUpdates(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Fails over the device to another device. - * - * @param {string} deviceName The device name. - * - * @param {object} failoverRequest The failover request. - * - * @param {array} [failoverRequest.accesspointIds] - * - * @param {string} [failoverRequest.targetDeviceId] - * - * @param {boolean} [failoverRequest.skipValidation] - * - * @param {boolean} [failoverRequest.keepSourceDevice] - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - failoverWithHttpOperationResponse(deviceName, failoverRequest, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._failover(deviceName, failoverRequest, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Fails over the device to another device. - * - * @param {string} deviceName The device name. - * - * @param {object} failoverRequest The failover request. - * - * @param {array} [failoverRequest.accesspointIds] - * - * @param {string} [failoverRequest.targetDeviceId] - * - * @param {boolean} [failoverRequest.skipValidation] - * - * @param {boolean} [failoverRequest.keepSourceDevice] - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - failover(deviceName, failoverRequest, resourceGroupName, managerName, 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._failover(deviceName, failoverRequest, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._failover(deviceName, failoverRequest, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Retrieves all the devices which can be used as failover targets for the - * given device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Specify $expand=details to populate - * additional fields related to the device. - * - * @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. - */ - listFailoverTargetWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listFailoverTarget(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the devices which can be used as failover targets for the - * given device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Specify $expand=details to populate - * additional fields related to the device. - * - * @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 {DeviceList} - 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 DeviceList} 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. - */ - listFailoverTarget(deviceName, resourceGroupName, managerName, 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._listFailoverTarget(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listFailoverTarget(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Installs the updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - installUpdatesWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._installUpdates(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Installs the updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - installUpdates(deviceName, resourceGroupName, managerName, 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._installUpdates(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._installUpdates(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Retrieves the device metrics. - * - * @param {string} deviceName The name of the appliance. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listMetricsWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetrics(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves the device metrics. - * - * @param {string} deviceName The name of the appliance. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {MetricList} - 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 MetricList} 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. - */ - listMetrics(deviceName, resourceGroupName, managerName, 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._listMetrics(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetrics(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Retrieves metric definition of all metrics aggregated at device. - * - * @param {string} deviceName The name of the appliance. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listMetricDefinitionWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetricDefinition(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves metric definition of all metrics aggregated at device. - * - * @param {string} deviceName The name of the appliance. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {MetricDefinitionList} - 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 MetricDefinitionList} 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. - */ - listMetricDefinition(deviceName, resourceGroupName, managerName, 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._listMetricDefinition(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetricDefinition(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Returns the network settings of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - getNetworkSettingsWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getNetworkSettings(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the network settings of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {NetworkSettings} - 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 NetworkSettings} 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. - */ - getNetworkSettings(deviceName, resourceGroupName, managerName, 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._getNetworkSettings(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getNetworkSettings(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Scans for updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - scanForUpdatesWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._scanForUpdates(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Scans for updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - scanForUpdates(deviceName, resourceGroupName, managerName, 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._scanForUpdates(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._scanForUpdates(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the security settings. - * - * @param {string} deviceName The device name. - * - * @param {object} securitySettings The security settings. - * - * @param {object} securitySettings.deviceAdminPassword Device administrator - * password as an encrypted string (encrypted using RSA PKCS #1) is used to log - * into the local web UI of the device. Actual password could have at least 8 - * characters that are a combination of uppercase, lowercase, numeric, and - * special characters - * - * @param {string} securitySettings.deviceAdminPassword.value The value of the - * secret itself. If the secret is in plaintext then EncryptionAlgorithm will - * be none and EncryptionCertThumbprint will be null. - * - * @param {string} - * [securitySettings.deviceAdminPassword.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} securitySettings.deviceAdminPassword.encryptionAlgorithm - * Algorithm used to encrypt "Value". Possible values include: 'None', - * 'AES256', 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - createOrUpdateSecuritySettingsWithHttpOperationResponse(deviceName, securitySettings, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdateSecuritySettings(deviceName, securitySettings, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the security settings. - * - * @param {string} deviceName The device name. - * - * @param {object} securitySettings The security settings. - * - * @param {object} securitySettings.deviceAdminPassword Device administrator - * password as an encrypted string (encrypted using RSA PKCS #1) is used to log - * into the local web UI of the device. Actual password could have at least 8 - * characters that are a combination of uppercase, lowercase, numeric, and - * special characters - * - * @param {string} securitySettings.deviceAdminPassword.value The value of the - * secret itself. If the secret is in plaintext then EncryptionAlgorithm will - * be none and EncryptionCertThumbprint will be null. - * - * @param {string} - * [securitySettings.deviceAdminPassword.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} securitySettings.deviceAdminPassword.encryptionAlgorithm - * Algorithm used to encrypt "Value". Possible values include: 'None', - * 'AES256', 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - createOrUpdateSecuritySettings(deviceName, securitySettings, resourceGroupName, managerName, 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._createOrUpdateSecuritySettings(deviceName, securitySettings, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdateSecuritySettings(deviceName, securitySettings, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Returns the time settings of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - getTimeSettingsWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getTimeSettings(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the time settings of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {TimeSettings} - 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 TimeSettings} 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. - */ - getTimeSettings(deviceName, resourceGroupName, managerName, 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._getTimeSettings(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getTimeSettings(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Returns the update summary of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - getUpdateSummaryWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getUpdateSummary(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the update summary of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {Updates} - 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 Updates} 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. - */ - getUpdateSummary(deviceName, resourceGroupName, managerName, 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._getUpdateSummary(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getUpdateSummary(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(deviceName, resourceGroupName, managerName, 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._beginDeleteMethod(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Patches the device. - * - * @param {string} deviceName The device Name. - * - * @param {object} devicePatch Patch representation of the device. - * - * @param {string} [devicePatch.deviceDescription] Short description given for - * the device - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginPatchWithHttpOperationResponse(deviceName, devicePatch, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginPatch(deviceName, devicePatch, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Patches the device. - * - * @param {string} deviceName The device Name. - * - * @param {object} devicePatch Patch representation of the device. - * - * @param {string} [devicePatch.deviceDescription] Short description given for - * the device - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {Device} - 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 Device} 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. - */ - beginPatch(deviceName, devicePatch, resourceGroupName, managerName, 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._beginPatch(deviceName, devicePatch, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginPatch(deviceName, devicePatch, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the alert settings - * - * @param {string} deviceName The device name. - * - * @param {object} alertSettings The alert settings. - * - * @param {string} alertSettings.emailNotification Value indicating whether - * user/admins will receive emails when an alert condition occurs on the - * system. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.notificationToServiceOwners Value indicating - * whether service owners will receive emails when an alert condition occurs on - * the system. Applicable only if emailNotification flag is Enabled. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.alertNotificationCulture Culture setting to be - * used while building alert emails. For eg: "en-US" - * - * @param {array} [alertSettings.additionalRecipientEmailList] List of email - * addresses (apart from admin/coadmin of subscription) to whom the alert - * emails need to be sent - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateAlertSettingsWithHttpOperationResponse(deviceName, alertSettings, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdateAlertSettings(deviceName, alertSettings, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the alert settings - * - * @param {string} deviceName The device name. - * - * @param {object} alertSettings The alert settings. - * - * @param {string} alertSettings.emailNotification Value indicating whether - * user/admins will receive emails when an alert condition occurs on the - * system. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.notificationToServiceOwners Value indicating - * whether service owners will receive emails when an alert condition occurs on - * the system. Applicable only if emailNotification flag is Enabled. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.alertNotificationCulture Culture setting to be - * used while building alert emails. For eg: "en-US" - * - * @param {array} [alertSettings.additionalRecipientEmailList] List of email - * addresses (apart from admin/coadmin of subscription) to whom the alert - * emails need to be sent - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {AlertSettings} - 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 AlertSettings} 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. - */ - beginCreateOrUpdateAlertSettings(deviceName, alertSettings, resourceGroupName, managerName, 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._beginCreateOrUpdateAlertSettings(deviceName, alertSettings, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdateAlertSettings(deviceName, alertSettings, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deactivates the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeactivateWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeactivate(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deactivates the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeactivate(deviceName, resourceGroupName, managerName, 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._beginDeactivate(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeactivate(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Downloads udpates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDownloadUpdatesWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDownloadUpdates(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Downloads udpates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDownloadUpdates(deviceName, resourceGroupName, managerName, 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._beginDownloadUpdates(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDownloadUpdates(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Fails over the device to another device. - * - * @param {string} deviceName The device name. - * - * @param {object} failoverRequest The failover request. - * - * @param {array} [failoverRequest.accesspointIds] - * - * @param {string} [failoverRequest.targetDeviceId] - * - * @param {boolean} [failoverRequest.skipValidation] - * - * @param {boolean} [failoverRequest.keepSourceDevice] - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginFailoverWithHttpOperationResponse(deviceName, failoverRequest, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginFailover(deviceName, failoverRequest, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Fails over the device to another device. - * - * @param {string} deviceName The device name. - * - * @param {object} failoverRequest The failover request. - * - * @param {array} [failoverRequest.accesspointIds] - * - * @param {string} [failoverRequest.targetDeviceId] - * - * @param {boolean} [failoverRequest.skipValidation] - * - * @param {boolean} [failoverRequest.keepSourceDevice] - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginFailover(deviceName, failoverRequest, resourceGroupName, managerName, 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._beginFailover(deviceName, failoverRequest, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginFailover(deviceName, failoverRequest, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Installs the updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginInstallUpdatesWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginInstallUpdates(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Installs the updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginInstallUpdates(deviceName, resourceGroupName, managerName, 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._beginInstallUpdates(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginInstallUpdates(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Scans for updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginScanForUpdatesWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginScanForUpdates(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Scans for updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginScanForUpdates(deviceName, resourceGroupName, managerName, 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._beginScanForUpdates(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginScanForUpdates(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the security settings. - * - * @param {string} deviceName The device name. - * - * @param {object} securitySettings The security settings. - * - * @param {object} securitySettings.deviceAdminPassword Device administrator - * password as an encrypted string (encrypted using RSA PKCS #1) is used to log - * into the local web UI of the device. Actual password could have at least 8 - * characters that are a combination of uppercase, lowercase, numeric, and - * special characters - * - * @param {string} securitySettings.deviceAdminPassword.value The value of the - * secret itself. If the secret is in plaintext then EncryptionAlgorithm will - * be none and EncryptionCertThumbprint will be null. - * - * @param {string} - * [securitySettings.deviceAdminPassword.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} securitySettings.deviceAdminPassword.encryptionAlgorithm - * Algorithm used to encrypt "Value". Possible values include: 'None', - * 'AES256', 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateSecuritySettingsWithHttpOperationResponse(deviceName, securitySettings, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdateSecuritySettings(deviceName, securitySettings, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the security settings. - * - * @param {string} deviceName The device name. - * - * @param {object} securitySettings The security settings. - * - * @param {object} securitySettings.deviceAdminPassword Device administrator - * password as an encrypted string (encrypted using RSA PKCS #1) is used to log - * into the local web UI of the device. Actual password could have at least 8 - * characters that are a combination of uppercase, lowercase, numeric, and - * special characters - * - * @param {string} securitySettings.deviceAdminPassword.value The value of the - * secret itself. If the secret is in plaintext then EncryptionAlgorithm will - * be none and EncryptionCertThumbprint will be null. - * - * @param {string} - * [securitySettings.deviceAdminPassword.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} securitySettings.deviceAdminPassword.encryptionAlgorithm - * Algorithm used to encrypt "Value". Possible values include: 'None', - * 'AES256', 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateSecuritySettings(deviceName, securitySettings, resourceGroupName, managerName, 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._beginCreateOrUpdateSecuritySettings(deviceName, securitySettings, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdateSecuritySettings(deviceName, securitySettings, resourceGroupName, managerName, options, optionalCallback); - } - } - -} - -module.exports = Devices; diff --git a/lib/services/storSimple1200Series/lib/operations/fileServers.js b/lib/services/storSimple1200Series/lib/operations/fileServers.js deleted file mode 100644 index dc8d9084df..0000000000 --- a/lib/services/storSimple1200Series/lib/operations/fileServers.js +++ /dev/null @@ -1,2654 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * Retrieves all the file servers in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 FileServerList} 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 _listByDevice(deviceName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['FileServerList']().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); - }); -} - -/** - * Returns the properties of the specified file server name. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 FileServer} 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(deviceName, fileServerName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (fileServerName === null || fileServerName === undefined || typeof fileServerName.valueOf() !== 'string') { - throw new Error('fileServerName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{fileServerName}', encodeURIComponent(fileServerName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['FileServer']().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); - }); -} - - -/** - * Creates or updates the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {object} fileServer The file server. - * - * @param {string} fileServer.domainName Domain of the file server - * - * @param {string} fileServer.storageDomainId The storage domain id. - * - * @param {string} fileServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [fileServer.description] The description of the file server - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 FileServer} 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(deviceName, fileServerName, fileServer, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginCreateOrUpdate(deviceName, fileServerName, fileServer, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FileServer']().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 the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, fileServerName, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginDeleteMethod(deviceName, fileServerName, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Backup the file server now. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _backupNow(deviceName, fileServerName, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginBackupNow(deviceName, fileServerName, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the file server metrics. - * - * @param {string} deviceName The name of the device. - * - * @param {string} fileServerName The name of the file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 MetricList} 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 _listMetrics(deviceName, fileServerName, resourceGroupName, managerName, 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.'); - } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - // Validate - try { - if (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (fileServerName === null || fileServerName === undefined || typeof fileServerName.valueOf() !== 'string') { - throw new Error('fileServerName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter 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.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/metrics'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{fileServerName}', encodeURIComponent(fileServerName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['MetricList']().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); - }); -} - -/** - * Retrieves metric definitions of all metrics aggregated at the file server. - * - * @param {string} deviceName The name of the device. - * - * @param {string} fileServerName The name of the file server. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 MetricDefinitionList} 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 _listMetricDefinition(deviceName, fileServerName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (fileServerName === null || fileServerName === undefined || typeof fileServerName.valueOf() !== 'string') { - throw new Error('fileServerName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/metricsDefinitions'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{fileServerName}', encodeURIComponent(fileServerName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['MetricDefinitionList']().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); - }); -} - -/** - * Retrieves all the file servers in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 FileServerList} 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 _listByManager(resourceGroupName, managerName, 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.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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/fileservers'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['FileServerList']().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); - }); -} - -/** - * Creates or updates the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {object} fileServer The file server. - * - * @param {string} fileServer.domainName Domain of the file server - * - * @param {string} fileServer.storageDomainId The storage domain id. - * - * @param {string} fileServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [fileServer.description] The description of the file server - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 FileServer} 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 _beginCreateOrUpdate(deviceName, fileServerName, fileServer, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (fileServerName === null || fileServerName === undefined || typeof fileServerName.valueOf() !== 'string') { - throw new Error('fileServerName cannot be null or undefined and it must be of type string.'); - } - if (fileServer === null || fileServer === undefined) { - throw new Error('fileServer cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{fileServerName}', encodeURIComponent(fileServerName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 (fileServer !== null && fileServer !== undefined) { - let requestModelMapper = new client.models['FileServer']().mapper(); - requestModel = client.serialize(requestModelMapper, fileServer, 'fileServer'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(fileServer, 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 !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['FileServer']().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 the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginDeleteMethod(deviceName, fileServerName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (fileServerName === null || fileServerName === undefined || typeof fileServerName.valueOf() !== 'string') { - throw new Error('fileServerName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{fileServerName}', encodeURIComponent(fileServerName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** - * Backup the file server now. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginBackupNow(deviceName, fileServerName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (fileServerName === null || fileServerName === undefined || typeof fileServerName.valueOf() !== 'string') { - throw new Error('fileServerName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/backup'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{fileServerName}', encodeURIComponent(fileServerName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** Class representing a FileServers. */ -class FileServers { - /** - * Create a FileServers. - * @param {StorSimpleManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listByDevice = _listByDevice; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._deleteMethod = _deleteMethod; - this._backupNow = _backupNow; - this._listMetrics = _listMetrics; - this._listMetricDefinition = _listMetricDefinition; - this._listByManager = _listByManager; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginBackupNow = _beginBackupNow; - } - - /** - * Retrieves all the file servers in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByDeviceWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByDevice(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the file servers in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileServerList} - 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 FileServerList} 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. - */ - listByDevice(deviceName, resourceGroupName, managerName, 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._listByDevice(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByDevice(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Returns the properties of the specified file server name. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, fileServerName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(deviceName, fileServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the properties of the specified file server name. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileServer} - 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 FileServer} 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(deviceName, fileServerName, resourceGroupName, managerName, 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(deviceName, fileServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(deviceName, fileServerName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {object} fileServer The file server. - * - * @param {string} fileServer.domainName Domain of the file server - * - * @param {string} fileServer.storageDomainId The storage domain id. - * - * @param {string} fileServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [fileServer.description] The description of the file server - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, fileServerName, fileServer, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(deviceName, fileServerName, fileServer, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {object} fileServer The file server. - * - * @param {string} fileServer.domainName Domain of the file server - * - * @param {string} fileServer.storageDomainId The storage domain id. - * - * @param {string} fileServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [fileServer.description] The description of the file server - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileServer} - 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 FileServer} 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(deviceName, fileServerName, fileServer, resourceGroupName, managerName, 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(deviceName, fileServerName, fileServer, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(deviceName, fileServerName, fileServer, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, fileServerName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(deviceName, fileServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, fileServerName, resourceGroupName, managerName, 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(deviceName, fileServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(deviceName, fileServerName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Backup the file server now. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - backupNowWithHttpOperationResponse(deviceName, fileServerName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._backupNow(deviceName, fileServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Backup the file server now. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - backupNow(deviceName, fileServerName, resourceGroupName, managerName, 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._backupNow(deviceName, fileServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._backupNow(deviceName, fileServerName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Gets the file server metrics. - * - * @param {string} deviceName The name of the device. - * - * @param {string} fileServerName The name of the file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listMetricsWithHttpOperationResponse(deviceName, fileServerName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetrics(deviceName, fileServerName, resourceGroupName, managerName, 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 file server metrics. - * - * @param {string} deviceName The name of the device. - * - * @param {string} fileServerName The name of the file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {MetricList} - 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 MetricList} 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. - */ - listMetrics(deviceName, fileServerName, resourceGroupName, managerName, 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._listMetrics(deviceName, fileServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetrics(deviceName, fileServerName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Retrieves metric definitions of all metrics aggregated at the file server. - * - * @param {string} deviceName The name of the device. - * - * @param {string} fileServerName The name of the file server. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listMetricDefinitionWithHttpOperationResponse(deviceName, fileServerName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetricDefinition(deviceName, fileServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves metric definitions of all metrics aggregated at the file server. - * - * @param {string} deviceName The name of the device. - * - * @param {string} fileServerName The name of the file server. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {MetricDefinitionList} - 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 MetricDefinitionList} 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. - */ - listMetricDefinition(deviceName, fileServerName, resourceGroupName, managerName, 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._listMetricDefinition(deviceName, fileServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetricDefinition(deviceName, fileServerName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Retrieves all the file servers in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByManagerWithHttpOperationResponse(resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByManager(resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the file servers in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileServerList} - 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 FileServerList} 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. - */ - listByManager(resourceGroupName, managerName, 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._listByManager(resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByManager(resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {object} fileServer The file server. - * - * @param {string} fileServer.domainName Domain of the file server - * - * @param {string} fileServer.storageDomainId The storage domain id. - * - * @param {string} fileServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [fileServer.description] The description of the file server - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(deviceName, fileServerName, fileServer, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(deviceName, fileServerName, fileServer, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {object} fileServer The file server. - * - * @param {string} fileServer.domainName Domain of the file server - * - * @param {string} fileServer.storageDomainId The storage domain id. - * - * @param {string} fileServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [fileServer.description] The description of the file server - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileServer} - 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 FileServer} 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. - */ - beginCreateOrUpdate(deviceName, fileServerName, fileServer, resourceGroupName, managerName, 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._beginCreateOrUpdate(deviceName, fileServerName, fileServer, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(deviceName, fileServerName, fileServer, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(deviceName, fileServerName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(deviceName, fileServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(deviceName, fileServerName, resourceGroupName, managerName, 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._beginDeleteMethod(deviceName, fileServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(deviceName, fileServerName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Backup the file server now. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginBackupNowWithHttpOperationResponse(deviceName, fileServerName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginBackupNow(deviceName, fileServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Backup the file server now. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginBackupNow(deviceName, fileServerName, resourceGroupName, managerName, 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._beginBackupNow(deviceName, fileServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginBackupNow(deviceName, fileServerName, resourceGroupName, managerName, options, optionalCallback); - } - } - -} - -module.exports = FileServers; diff --git a/lib/services/storSimple1200Series/lib/operations/fileShares.js b/lib/services/storSimple1200Series/lib/operations/fileShares.js deleted file mode 100644 index fb2fab92bd..0000000000 --- a/lib/services/storSimple1200Series/lib/operations/fileShares.js +++ /dev/null @@ -1,2391 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * Retrieves all the file shares in a file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 FileShareList} 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 _listByFileServer(deviceName, fileServerName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (fileServerName === null || fileServerName === undefined || typeof fileServerName.valueOf() !== 'string') { - throw new Error('fileServerName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{fileServerName}', encodeURIComponent(fileServerName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['FileShareList']().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); - }); -} - -/** - * Returns the properties of the specified file share name. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 FileShare} 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(deviceName, fileServerName, shareName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (fileServerName === null || fileServerName === undefined || typeof fileServerName.valueOf() !== 'string') { - throw new Error('fileServerName cannot be null or undefined and it must be of type string.'); - } - if (shareName === null || shareName === undefined || typeof shareName.valueOf() !== 'string') { - throw new Error('shareName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{fileServerName}', encodeURIComponent(fileServerName)); - requestUrl = requestUrl.replace('{shareName}', encodeURIComponent(shareName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['FileShare']().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); - }); -} - - -/** - * Creates or updates the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {object} fileShare The file share. - * - * @param {string} [fileShare.description] Description for file share - * - * @param {string} fileShare.shareStatus The Share Status. Possible values - * include: 'Online', 'Offline' - * - * @param {string} fileShare.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} fileShare.adminUser The user/group who will have full - * permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} fileShare.provisionedCapacityInBytes The total provisioned - * capacity in Bytes - * - * @param {string} fileShare.monitoringStatus The monitoring status. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 FileShare} 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(deviceName, fileServerName, shareName, fileShare, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginCreateOrUpdate(deviceName, fileServerName, shareName, fileShare, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FileShare']().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 the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share Name - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, fileServerName, shareName, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginDeleteMethod(deviceName, fileServerName, shareName, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the file share metrics - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 MetricList} 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 _listMetrics(deviceName, fileServerName, shareName, resourceGroupName, managerName, 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.'); - } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - // Validate - try { - if (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (fileServerName === null || fileServerName === undefined || typeof fileServerName.valueOf() !== 'string') { - throw new Error('fileServerName cannot be null or undefined and it must be of type string.'); - } - if (shareName === null || shareName === undefined || typeof shareName.valueOf() !== 'string') { - throw new Error('shareName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter 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.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}/metrics'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{fileServerName}', encodeURIComponent(fileServerName)); - requestUrl = requestUrl.replace('{shareName}', encodeURIComponent(shareName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['MetricList']().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); - }); -} - -/** - * Retrieves metric definitions of all metrics aggregated at the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 MetricDefinitionList} 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 _listMetricDefinition(deviceName, fileServerName, shareName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (fileServerName === null || fileServerName === undefined || typeof fileServerName.valueOf() !== 'string') { - throw new Error('fileServerName cannot be null or undefined and it must be of type string.'); - } - if (shareName === null || shareName === undefined || typeof shareName.valueOf() !== 'string') { - throw new Error('shareName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}/metricsDefinitions'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{fileServerName}', encodeURIComponent(fileServerName)); - requestUrl = requestUrl.replace('{shareName}', encodeURIComponent(shareName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['MetricDefinitionList']().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); - }); -} - -/** - * Retrieves all the file shares in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 FileShareList} 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 _listByDevice(deviceName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/shares'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['FileShareList']().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); - }); -} - -/** - * Creates or updates the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {object} fileShare The file share. - * - * @param {string} [fileShare.description] Description for file share - * - * @param {string} fileShare.shareStatus The Share Status. Possible values - * include: 'Online', 'Offline' - * - * @param {string} fileShare.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} fileShare.adminUser The user/group who will have full - * permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} fileShare.provisionedCapacityInBytes The total provisioned - * capacity in Bytes - * - * @param {string} fileShare.monitoringStatus The monitoring status. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 FileShare} 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 _beginCreateOrUpdate(deviceName, fileServerName, shareName, fileShare, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (fileServerName === null || fileServerName === undefined || typeof fileServerName.valueOf() !== 'string') { - throw new Error('fileServerName cannot be null or undefined and it must be of type string.'); - } - if (shareName === null || shareName === undefined || typeof shareName.valueOf() !== 'string') { - throw new Error('shareName cannot be null or undefined and it must be of type string.'); - } - if (fileShare === null || fileShare === undefined) { - throw new Error('fileShare cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{fileServerName}', encodeURIComponent(fileServerName)); - requestUrl = requestUrl.replace('{shareName}', encodeURIComponent(shareName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 (fileShare !== null && fileShare !== undefined) { - let requestModelMapper = new client.models['FileShare']().mapper(); - requestModel = client.serialize(requestModelMapper, fileShare, 'fileShare'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(fileShare, 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 !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['FileShare']().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 the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share Name - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginDeleteMethod(deviceName, fileServerName, shareName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (fileServerName === null || fileServerName === undefined || typeof fileServerName.valueOf() !== 'string') { - throw new Error('fileServerName cannot be null or undefined and it must be of type string.'); - } - if (shareName === null || shareName === undefined || typeof shareName.valueOf() !== 'string') { - throw new Error('shareName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/fileservers/{fileServerName}/shares/{shareName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{fileServerName}', encodeURIComponent(fileServerName)); - requestUrl = requestUrl.replace('{shareName}', encodeURIComponent(shareName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** Class representing a FileShares. */ -class FileShares { - /** - * Create a FileShares. - * @param {StorSimpleManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listByFileServer = _listByFileServer; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._deleteMethod = _deleteMethod; - this._listMetrics = _listMetrics; - this._listMetricDefinition = _listMetricDefinition; - this._listByDevice = _listByDevice; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - } - - /** - * Retrieves all the file shares in a file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByFileServerWithHttpOperationResponse(deviceName, fileServerName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByFileServer(deviceName, fileServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the file shares in a file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileShareList} - 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 FileShareList} 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. - */ - listByFileServer(deviceName, fileServerName, resourceGroupName, managerName, 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._listByFileServer(deviceName, fileServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByFileServer(deviceName, fileServerName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Returns the properties of the specified file share name. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, fileServerName, shareName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(deviceName, fileServerName, shareName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the properties of the specified file share name. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileShare} - 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 FileShare} 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(deviceName, fileServerName, shareName, resourceGroupName, managerName, 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(deviceName, fileServerName, shareName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(deviceName, fileServerName, shareName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {object} fileShare The file share. - * - * @param {string} [fileShare.description] Description for file share - * - * @param {string} fileShare.shareStatus The Share Status. Possible values - * include: 'Online', 'Offline' - * - * @param {string} fileShare.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} fileShare.adminUser The user/group who will have full - * permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} fileShare.provisionedCapacityInBytes The total provisioned - * capacity in Bytes - * - * @param {string} fileShare.monitoringStatus The monitoring status. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, fileServerName, shareName, fileShare, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(deviceName, fileServerName, shareName, fileShare, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {object} fileShare The file share. - * - * @param {string} [fileShare.description] Description for file share - * - * @param {string} fileShare.shareStatus The Share Status. Possible values - * include: 'Online', 'Offline' - * - * @param {string} fileShare.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} fileShare.adminUser The user/group who will have full - * permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} fileShare.provisionedCapacityInBytes The total provisioned - * capacity in Bytes - * - * @param {string} fileShare.monitoringStatus The monitoring status. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileShare} - 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 FileShare} 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(deviceName, fileServerName, shareName, fileShare, resourceGroupName, managerName, 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(deviceName, fileServerName, shareName, fileShare, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(deviceName, fileServerName, shareName, fileShare, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share Name - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, fileServerName, shareName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(deviceName, fileServerName, shareName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share Name - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, fileServerName, shareName, resourceGroupName, managerName, 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(deviceName, fileServerName, shareName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(deviceName, fileServerName, shareName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Gets the file share metrics - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listMetricsWithHttpOperationResponse(deviceName, fileServerName, shareName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetrics(deviceName, fileServerName, shareName, resourceGroupName, managerName, 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 file share metrics - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {MetricList} - 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 MetricList} 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. - */ - listMetrics(deviceName, fileServerName, shareName, resourceGroupName, managerName, 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._listMetrics(deviceName, fileServerName, shareName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetrics(deviceName, fileServerName, shareName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Retrieves metric definitions of all metrics aggregated at the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listMetricDefinitionWithHttpOperationResponse(deviceName, fileServerName, shareName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetricDefinition(deviceName, fileServerName, shareName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves metric definitions of all metrics aggregated at the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {MetricDefinitionList} - 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 MetricDefinitionList} 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. - */ - listMetricDefinition(deviceName, fileServerName, shareName, resourceGroupName, managerName, 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._listMetricDefinition(deviceName, fileServerName, shareName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetricDefinition(deviceName, fileServerName, shareName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Retrieves all the file shares in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByDeviceWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByDevice(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the file shares in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileShareList} - 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 FileShareList} 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. - */ - listByDevice(deviceName, resourceGroupName, managerName, 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._listByDevice(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByDevice(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {object} fileShare The file share. - * - * @param {string} [fileShare.description] Description for file share - * - * @param {string} fileShare.shareStatus The Share Status. Possible values - * include: 'Online', 'Offline' - * - * @param {string} fileShare.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} fileShare.adminUser The user/group who will have full - * permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} fileShare.provisionedCapacityInBytes The total provisioned - * capacity in Bytes - * - * @param {string} fileShare.monitoringStatus The monitoring status. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(deviceName, fileServerName, shareName, fileShare, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(deviceName, fileServerName, shareName, fileShare, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {object} fileShare The file share. - * - * @param {string} [fileShare.description] Description for file share - * - * @param {string} fileShare.shareStatus The Share Status. Possible values - * include: 'Online', 'Offline' - * - * @param {string} fileShare.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} fileShare.adminUser The user/group who will have full - * permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} fileShare.provisionedCapacityInBytes The total provisioned - * capacity in Bytes - * - * @param {string} fileShare.monitoringStatus The monitoring status. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileShare} - 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 FileShare} 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. - */ - beginCreateOrUpdate(deviceName, fileServerName, shareName, fileShare, resourceGroupName, managerName, 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._beginCreateOrUpdate(deviceName, fileServerName, shareName, fileShare, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(deviceName, fileServerName, shareName, fileShare, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share Name - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(deviceName, fileServerName, shareName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(deviceName, fileServerName, shareName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share Name - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(deviceName, fileServerName, shareName, resourceGroupName, managerName, 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._beginDeleteMethod(deviceName, fileServerName, shareName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(deviceName, fileServerName, shareName, resourceGroupName, managerName, options, optionalCallback); - } - } - -} - -module.exports = FileShares; diff --git a/lib/services/storSimple1200Series/lib/operations/index.d.ts b/lib/services/storSimple1200Series/lib/operations/index.d.ts deleted file mode 100644 index e96dce40d3..0000000000 --- a/lib/services/storSimple1200Series/lib/operations/index.d.ts +++ /dev/null @@ -1,9719 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. -*/ - -import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationResponse } from 'ms-rest'; -import * as models from '../models'; - - -/** - * @class - * Managers - * __NOTE__: An instance of this class is automatically created for an - * instance of the StorSimpleManagementClient. - */ -export interface Managers { - - - /** - * Retrieves all the managers in a subscription. - * - * @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>; - - /** - * Retrieves all the managers in a subscription. - * - * @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 {ManagerList} - 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. - * - * {ManagerList} [result] - The deserialized result object if an error did not occur. - * See {@link ManagerList} 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; - - - /** - * Retrieves all the managers in a resource group. - * - * @param {string} resourceGroupName The resource group name - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the managers in a resource group. - * - * @param {string} resourceGroupName The resource group name - * - * @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 {ManagerList} - 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. - * - * {ManagerList} [result] - The deserialized result object if an error did not occur. - * See {@link ManagerList} 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. - */ - listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; - listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the properties of the specified manager name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the properties of the specified manager name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {Manager} - 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. - * - * {Manager} [result] - The deserialized result object if an error did not occur. - * See {@link Manager} 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, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the manager. - * - * @param {object} manager The manager. - * - * @param {object} [manager.cisIntrinsicSettings] Specifies if the Manager is - * Garda or Helsinki - * - * @param {string} manager.cisIntrinsicSettings.type Refers to the type of the - * StorSimple Manager. Possible values include: 'GardaV1', 'HelsinkiV1' - * - * @param {string} [manager.etag] ETag of the Manager - * - * @param {string} manager.location The Geo location of the Manager - * - * @param {object} [manager.tags] Tags attached to the Manager - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(manager: models.Manager, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the manager. - * - * @param {object} manager The manager. - * - * @param {object} [manager.cisIntrinsicSettings] Specifies if the Manager is - * Garda or Helsinki - * - * @param {string} manager.cisIntrinsicSettings.type Refers to the type of the - * StorSimple Manager. Possible values include: 'GardaV1', 'HelsinkiV1' - * - * @param {string} [manager.etag] ETag of the Manager - * - * @param {string} manager.location The Geo location of the Manager - * - * @param {object} [manager.tags] Tags attached to the Manager - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {Manager} - 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. - * - * {Manager} [result] - The deserialized result object if an error did not occur. - * See {@link Manager} 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(manager: models.Manager, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(manager: models.Manager, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - createOrUpdate(manager: models.Manager, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates the StorSimple Manager. - * - * @param {object} parameters The manager update parameters. - * - * @param {object} [parameters.tags] The tags attached to the StorSimple - * Manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - updateWithHttpOperationResponse(parameters: models.ManagerPatch, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates the StorSimple Manager. - * - * @param {object} parameters The manager update parameters. - * - * @param {object} [parameters.tags] The tags attached to the StorSimple - * Manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {Manager} - 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. - * - * {Manager} [result] - The deserialized result object if an error did not occur. - * See {@link Manager} 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. - */ - update(parameters: models.ManagerPatch, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(parameters: models.ManagerPatch, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - update(parameters: models.ManagerPatch, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Upload Vault Cred Certificate. - * Returns UploadCertificateResponse - * - * @param {string} certificateName Certificate Name - * - * @param {object} uploadCertificateRequestrequest UploadCertificateRequest - * Request - * - * @param {string} [uploadCertificateRequestrequest.authType] Specify the - * Authentication type. Possible values include: 'Invalid', - * 'AccessControlService', 'AzureActiveDirectory' - * - * @param {string} uploadCertificateRequestrequest.certificate Gets or sets the - * base64 encoded certificate raw data string - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - uploadRegistrationCertificateWithHttpOperationResponse(certificateName: string, uploadCertificateRequestrequest: models.UploadCertificateRequest, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Upload Vault Cred Certificate. - * Returns UploadCertificateResponse - * - * @param {string} certificateName Certificate Name - * - * @param {object} uploadCertificateRequestrequest UploadCertificateRequest - * Request - * - * @param {string} [uploadCertificateRequestrequest.authType] Specify the - * Authentication type. Possible values include: 'Invalid', - * 'AccessControlService', 'AzureActiveDirectory' - * - * @param {string} uploadCertificateRequestrequest.certificate Gets or sets the - * base64 encoded certificate raw data string - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {UploadCertificateResponse} - 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. - * - * {UploadCertificateResponse} [result] - The deserialized result object if an error did not occur. - * See {@link UploadCertificateResponse} 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. - */ - uploadRegistrationCertificate(certificateName: string, uploadCertificateRequestrequest: models.UploadCertificateRequest, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - uploadRegistrationCertificate(certificateName: string, uploadCertificateRequestrequest: models.UploadCertificateRequest, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - uploadRegistrationCertificate(certificateName: string, uploadCertificateRequestrequest: models.UploadCertificateRequest, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the encryption settings of the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - getEncryptionSettingsWithHttpOperationResponse(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the encryption settings of the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {EncryptionSettings} - 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. - * - * {EncryptionSettings} [result] - The deserialized result object if an error did not occur. - * See {@link EncryptionSettings} 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. - */ - getEncryptionSettings(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getEncryptionSettings(resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - getEncryptionSettings(resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the extended information of the specified manager name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - getExtendedInfoWithHttpOperationResponse(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the extended information of the specified manager name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ManagerExtendedInfo} - 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. - * - * {ManagerExtendedInfo} [result] - The deserialized result object if an error did not occur. - * See {@link ManagerExtendedInfo} 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. - */ - getExtendedInfo(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getExtendedInfo(resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - getExtendedInfo(resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates the extended info of the manager. - * - * @param {object} managerExtendedInfo The manager extended information. - * - * @param {string} [managerExtendedInfo.version] Represents the version of the - * ExtendedInfo object being persisted - * - * @param {string} managerExtendedInfo.integrityKey Represents the CIK of the - * resource - * - * @param {string} [managerExtendedInfo.encryptionKey] Represents the CEK of - * the resource - * - * @param {string} [managerExtendedInfo.encryptionKeyThumbprint] Represents the - * Cert thumbprint that was used to encrypt the CEK - * - * @param {string} [managerExtendedInfo.portalCertificateThumbprint] Represents - * the portal thumbprint which can be used optionally to encrypt the entire - * data before storing it. - * - * @param {string} managerExtendedInfo.algorithm Represents the encryption - * algorithm used to encrypt the other keys. None - if EncryptionKey is saved - * in plain text format. AlgorithmName - if encryption is used - * - * @param {string} [managerExtendedInfo.etag] ETag of the Resource - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - createExtendedInfoWithHttpOperationResponse(managerExtendedInfo: models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates the extended info of the manager. - * - * @param {object} managerExtendedInfo The manager extended information. - * - * @param {string} [managerExtendedInfo.version] Represents the version of the - * ExtendedInfo object being persisted - * - * @param {string} managerExtendedInfo.integrityKey Represents the CIK of the - * resource - * - * @param {string} [managerExtendedInfo.encryptionKey] Represents the CEK of - * the resource - * - * @param {string} [managerExtendedInfo.encryptionKeyThumbprint] Represents the - * Cert thumbprint that was used to encrypt the CEK - * - * @param {string} [managerExtendedInfo.portalCertificateThumbprint] Represents - * the portal thumbprint which can be used optionally to encrypt the entire - * data before storing it. - * - * @param {string} managerExtendedInfo.algorithm Represents the encryption - * algorithm used to encrypt the other keys. None - if EncryptionKey is saved - * in plain text format. AlgorithmName - if encryption is used - * - * @param {string} [managerExtendedInfo.etag] ETag of the Resource - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ManagerExtendedInfo} - 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. - * - * {ManagerExtendedInfo} [result] - The deserialized result object if an error did not occur. - * See {@link ManagerExtendedInfo} 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. - */ - createExtendedInfo(managerExtendedInfo: models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createExtendedInfo(managerExtendedInfo: models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - createExtendedInfo(managerExtendedInfo: models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the extended info of the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - deleteExtendedInfoWithHttpOperationResponse(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the extended info of the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - deleteExtendedInfo(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteExtendedInfo(resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - deleteExtendedInfo(resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Updates the extended info of the manager. - * - * @param {object} managerExtendedInfo The manager extended information. - * - * @param {string} [managerExtendedInfo.version] Represents the version of the - * ExtendedInfo object being persisted - * - * @param {string} managerExtendedInfo.integrityKey Represents the CIK of the - * resource - * - * @param {string} [managerExtendedInfo.encryptionKey] Represents the CEK of - * the resource - * - * @param {string} [managerExtendedInfo.encryptionKeyThumbprint] Represents the - * Cert thumbprint that was used to encrypt the CEK - * - * @param {string} [managerExtendedInfo.portalCertificateThumbprint] Represents - * the portal thumbprint which can be used optionally to encrypt the entire - * data before storing it. - * - * @param {string} managerExtendedInfo.algorithm Represents the encryption - * algorithm used to encrypt the other keys. None - if EncryptionKey is saved - * in plain text format. AlgorithmName - if encryption is used - * - * @param {string} [managerExtendedInfo.etag] ETag of the Resource - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {string} ifMatch Pass the ETag of ExtendedInfo fetched from GET call - * - * @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. - */ - updateExtendedInfoWithHttpOperationResponse(managerExtendedInfo: models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, ifMatch: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Updates the extended info of the manager. - * - * @param {object} managerExtendedInfo The manager extended information. - * - * @param {string} [managerExtendedInfo.version] Represents the version of the - * ExtendedInfo object being persisted - * - * @param {string} managerExtendedInfo.integrityKey Represents the CIK of the - * resource - * - * @param {string} [managerExtendedInfo.encryptionKey] Represents the CEK of - * the resource - * - * @param {string} [managerExtendedInfo.encryptionKeyThumbprint] Represents the - * Cert thumbprint that was used to encrypt the CEK - * - * @param {string} [managerExtendedInfo.portalCertificateThumbprint] Represents - * the portal thumbprint which can be used optionally to encrypt the entire - * data before storing it. - * - * @param {string} managerExtendedInfo.algorithm Represents the encryption - * algorithm used to encrypt the other keys. None - if EncryptionKey is saved - * in plain text format. AlgorithmName - if encryption is used - * - * @param {string} [managerExtendedInfo.etag] ETag of the Resource - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {string} ifMatch Pass the ETag of ExtendedInfo fetched from GET call - * - * @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 {ManagerExtendedInfo} - 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. - * - * {ManagerExtendedInfo} [result] - The deserialized result object if an error did not occur. - * See {@link ManagerExtendedInfo} 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. - */ - updateExtendedInfo(managerExtendedInfo: models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, ifMatch: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateExtendedInfo(managerExtendedInfo: models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, ifMatch: string, callback: ServiceCallback): void; - updateExtendedInfo(managerExtendedInfo: models.ManagerExtendedInfo, resourceGroupName: string, managerName: string, ifMatch: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the symmetric encryption key of the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - getEncryptionKeyWithHttpOperationResponse(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the symmetric encryption key of the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {SymmetricEncryptedSecret} - 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. - * - * {SymmetricEncryptedSecret} [result] - The deserialized result object if an error did not occur. - * See {@link SymmetricEncryptedSecret} 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. - */ - getEncryptionKey(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getEncryptionKey(resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - getEncryptionKey(resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the manager metrics - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listMetricsWithHttpOperationResponse(resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the manager metrics - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {MetricList} - 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. - * - * {MetricList} [result] - The deserialized result object if an error did not occur. - * See {@link MetricList} 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. - */ - listMetrics(resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listMetrics(resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listMetrics(resourceGroupName: string, managerName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves metric definition of all metrics aggregated at manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listMetricDefinitionWithHttpOperationResponse(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves metric definition of all metrics aggregated at manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {MetricDefinitionList} - 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. - * - * {MetricDefinitionList} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionList} 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. - */ - listMetricDefinition(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetricDefinition(resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listMetricDefinition(resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * AvailableProviderOperationsOperations - * __NOTE__: An instance of this class is automatically created for an - * instance of the StorSimpleManagementClient. - */ -export interface AvailableProviderOperationsOperations { - - - /** - * List of AvailableProviderOperations - * - * @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>; - - /** - * List of AvailableProviderOperations - * - * @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 {AvailableProviderOperations} - 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. - * - * {AvailableProviderOperations} [result] - The deserialized result object if an error did not occur. - * See {@link AvailableProviderOperations} 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; - - - /** - * List of AvailableProviderOperations - * - * @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>; - - /** - * List of AvailableProviderOperations - * - * @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 {AvailableProviderOperations} - 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. - * - * {AvailableProviderOperations} [result] - The deserialized result object if an error did not occur. - * See {@link AvailableProviderOperations} 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 - * AccessControlRecords - * __NOTE__: An instance of this class is automatically created for an - * instance of the StorSimpleManagementClient. - */ -export interface AccessControlRecords { - - - /** - * Retrieves all the access control records in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByManagerWithHttpOperationResponse(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the access control records in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {AccessControlRecordList} - 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. - * - * {AccessControlRecordList} [result] - The deserialized result object if an error did not occur. - * See {@link AccessControlRecordList} 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. - */ - listByManager(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByManager(resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the properties of the specified access control record name. - * - * @param {string} accessControlRecordName Name of access control record to be - * fetched. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the properties of the specified access control record name. - * - * @param {string} accessControlRecordName Name of access control record to be - * fetched. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {AccessControlRecord} - 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. - * - * {AccessControlRecord} [result] - The deserialized result object if an error did not occur. - * See {@link AccessControlRecord} 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(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(accessControlRecordName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - get(accessControlRecordName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or Updates an access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record. - * - * @param {object} accessControlRecord The access control record to be added or - * updated. - * - * @param {string} accessControlRecord.initiatorName The Iscsi initiator name - * (IQN) - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(accessControlRecordName: string, accessControlRecord: models.AccessControlRecord, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or Updates an access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record. - * - * @param {object} accessControlRecord The access control record to be added or - * updated. - * - * @param {string} accessControlRecord.initiatorName The Iscsi initiator name - * (IQN) - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {AccessControlRecord} - 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. - * - * {AccessControlRecord} [result] - The deserialized result object if an error did not occur. - * See {@link AccessControlRecord} 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(accessControlRecordName: string, accessControlRecord: models.AccessControlRecord, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(accessControlRecordName: string, accessControlRecord: models.AccessControlRecord, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - createOrUpdate(accessControlRecordName: string, accessControlRecord: models.AccessControlRecord, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record to delete. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record to delete. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(accessControlRecordName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - deleteMethod(accessControlRecordName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or Updates an access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record. - * - * @param {object} accessControlRecord The access control record to be added or - * updated. - * - * @param {string} accessControlRecord.initiatorName The Iscsi initiator name - * (IQN) - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(accessControlRecordName: string, accessControlRecord: models.AccessControlRecord, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or Updates an access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record. - * - * @param {object} accessControlRecord The access control record to be added or - * updated. - * - * @param {string} accessControlRecord.initiatorName The Iscsi initiator name - * (IQN) - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {AccessControlRecord} - 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. - * - * {AccessControlRecord} [result] - The deserialized result object if an error did not occur. - * See {@link AccessControlRecord} 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. - */ - beginCreateOrUpdate(accessControlRecordName: string, accessControlRecord: models.AccessControlRecord, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(accessControlRecordName: string, accessControlRecord: models.AccessControlRecord, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginCreateOrUpdate(accessControlRecordName: string, accessControlRecord: models.AccessControlRecord, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record to delete. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the access control record. - * - * @param {string} accessControlRecordName The name of the access control - * record to delete. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(accessControlRecordName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(accessControlRecordName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginDeleteMethod(accessControlRecordName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Alerts - * __NOTE__: An instance of this class is automatically created for an - * instance of the StorSimpleManagementClient. - */ -export interface Alerts { - - - /** - * Retrieves all the alerts in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listByManagerWithHttpOperationResponse(resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the alerts in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {AlertList} - 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. - * - * {AlertList} [result] - The deserialized result object if an error did not occur. - * See {@link AlertList} 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. - */ - listByManager(resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByManager(resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Clear the alerts. - * - * @param {object} request The clear alert request. - * - * @param {string} [request.resolutionMessage] Resolution message while - * clearing the request - * - * @param {array} request.alerts List of alert Ids to be cleared - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - clearWithHttpOperationResponse(request: models.ClearAlertRequest, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Clear the alerts. - * - * @param {object} request The clear alert request. - * - * @param {string} [request.resolutionMessage] Resolution message while - * clearing the request - * - * @param {array} request.alerts List of alert Ids to be cleared - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - clear(request: models.ClearAlertRequest, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - clear(request: models.ClearAlertRequest, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - clear(request: models.ClearAlertRequest, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Sends a test alert email. - * - * @param {string} deviceName The device name. - * - * @param {object} request The send test alert email request. - * - * @param {array} request.emailList List of emails to send the test alerts - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - sendTestEmailWithHttpOperationResponse(deviceName: string, request: models.SendTestAlertEmailRequest, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Sends a test alert email. - * - * @param {string} deviceName The device name. - * - * @param {object} request The send test alert email request. - * - * @param {array} request.emailList List of emails to send the test alerts - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - sendTestEmail(deviceName: string, request: models.SendTestAlertEmailRequest, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - sendTestEmail(deviceName: string, request: models.SendTestAlertEmailRequest, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - sendTestEmail(deviceName: string, request: models.SendTestAlertEmailRequest, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all the alerts in a manager. - * - * @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. - */ - listByManagerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the alerts in a manager. - * - * @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 {AlertList} - 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. - * - * {AlertList} [result] - The deserialized result object if an error did not occur. - * See {@link AlertList} 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. - */ - listByManagerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByManagerNext(nextPageLink: string, callback: ServiceCallback): void; - listByManagerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Backups - * __NOTE__: An instance of this class is automatically created for an - * instance of the StorSimpleManagementClient. - */ -export interface Backups { - - - /** - * Retrieves all the backups in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listByManagerWithHttpOperationResponse(resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the backups in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {BackupList} - 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. - * - * {BackupList} [result] - The deserialized result object if an error did not occur. - * See {@link BackupList} 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. - */ - listByManager(resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByManager(resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all the backups in a device. Can be used to get the backups for - * failover also. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.forFailover] Set to true if you need backups which - * can be used for failover. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listByDeviceWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { forFailover? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the backups in a device. Can be used to get the backups for - * failover also. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.forFailover] Set to true if you need backups which - * can be used for failover. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {BackupList} - 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. - * - * {BackupList} [result] - The deserialized result object if an error did not occur. - * See {@link BackupList} 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. - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: { forFailover? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: { forFailover? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the backup. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the backup. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - deleteMethod(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Clones the given backup element to a new disk or share with given details. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} elementName The backup element name. - * - * @param {object} cloneRequest The clone request. - * - * @param {string} cloneRequest.targetDeviceId DeviceId of the device which - * will act as the Clone target - * - * @param {string} cloneRequest.targetAccessPointId Accesspoint Id on which - * clone job will performed. - * - * @param {string} cloneRequest.newEndpointName Name of new endpoint which will - * created as part of clone job. - * - * @param {object} [cloneRequest.share] Share Object. - * - * @param {string} [cloneRequest.share.description] Description for file share - * - * @param {string} cloneRequest.share.shareStatus The Share Status. Possible - * values include: 'Online', 'Offline' - * - * @param {string} cloneRequest.share.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} cloneRequest.share.adminUser The user/group who will have - * full permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} cloneRequest.share.provisionedCapacityInBytes The total - * provisioned capacity in Bytes - * - * @param {string} cloneRequest.share.monitoringStatus The monitoring status. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [cloneRequest.disk] Disk Object - * - * @param {string} [cloneRequest.disk.description] The description. - * - * @param {string} cloneRequest.disk.diskStatus The disk status. Possible - * values include: 'Online', 'Offline' - * - * @param {array} cloneRequest.disk.accessControlRecords The access control - * records. - * - * @param {string} cloneRequest.disk.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} cloneRequest.disk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} cloneRequest.disk.monitoringStatus The monitoring. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - cloneWithHttpOperationResponse(deviceName: string, backupName: string, elementName: string, cloneRequest: models.CloneRequest, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Clones the given backup element to a new disk or share with given details. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} elementName The backup element name. - * - * @param {object} cloneRequest The clone request. - * - * @param {string} cloneRequest.targetDeviceId DeviceId of the device which - * will act as the Clone target - * - * @param {string} cloneRequest.targetAccessPointId Accesspoint Id on which - * clone job will performed. - * - * @param {string} cloneRequest.newEndpointName Name of new endpoint which will - * created as part of clone job. - * - * @param {object} [cloneRequest.share] Share Object. - * - * @param {string} [cloneRequest.share.description] Description for file share - * - * @param {string} cloneRequest.share.shareStatus The Share Status. Possible - * values include: 'Online', 'Offline' - * - * @param {string} cloneRequest.share.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} cloneRequest.share.adminUser The user/group who will have - * full permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} cloneRequest.share.provisionedCapacityInBytes The total - * provisioned capacity in Bytes - * - * @param {string} cloneRequest.share.monitoringStatus The monitoring status. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [cloneRequest.disk] Disk Object - * - * @param {string} [cloneRequest.disk.description] The description. - * - * @param {string} cloneRequest.disk.diskStatus The disk status. Possible - * values include: 'Online', 'Offline' - * - * @param {array} cloneRequest.disk.accessControlRecords The access control - * records. - * - * @param {string} cloneRequest.disk.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} cloneRequest.disk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} cloneRequest.disk.monitoringStatus The monitoring. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - clone(deviceName: string, backupName: string, elementName: string, cloneRequest: models.CloneRequest, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - clone(deviceName: string, backupName: string, elementName: string, cloneRequest: models.CloneRequest, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - clone(deviceName: string, backupName: string, elementName: string, cloneRequest: models.CloneRequest, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the backup. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the backup. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginDeleteMethod(deviceName: string, backupName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Clones the given backup element to a new disk or share with given details. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} elementName The backup element name. - * - * @param {object} cloneRequest The clone request. - * - * @param {string} cloneRequest.targetDeviceId DeviceId of the device which - * will act as the Clone target - * - * @param {string} cloneRequest.targetAccessPointId Accesspoint Id on which - * clone job will performed. - * - * @param {string} cloneRequest.newEndpointName Name of new endpoint which will - * created as part of clone job. - * - * @param {object} [cloneRequest.share] Share Object. - * - * @param {string} [cloneRequest.share.description] Description for file share - * - * @param {string} cloneRequest.share.shareStatus The Share Status. Possible - * values include: 'Online', 'Offline' - * - * @param {string} cloneRequest.share.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} cloneRequest.share.adminUser The user/group who will have - * full permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} cloneRequest.share.provisionedCapacityInBytes The total - * provisioned capacity in Bytes - * - * @param {string} cloneRequest.share.monitoringStatus The monitoring status. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [cloneRequest.disk] Disk Object - * - * @param {string} [cloneRequest.disk.description] The description. - * - * @param {string} cloneRequest.disk.diskStatus The disk status. Possible - * values include: 'Online', 'Offline' - * - * @param {array} cloneRequest.disk.accessControlRecords The access control - * records. - * - * @param {string} cloneRequest.disk.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} cloneRequest.disk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} cloneRequest.disk.monitoringStatus The monitoring. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCloneWithHttpOperationResponse(deviceName: string, backupName: string, elementName: string, cloneRequest: models.CloneRequest, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Clones the given backup element to a new disk or share with given details. - * - * @param {string} deviceName The device name. - * - * @param {string} backupName The backup name. - * - * @param {string} elementName The backup element name. - * - * @param {object} cloneRequest The clone request. - * - * @param {string} cloneRequest.targetDeviceId DeviceId of the device which - * will act as the Clone target - * - * @param {string} cloneRequest.targetAccessPointId Accesspoint Id on which - * clone job will performed. - * - * @param {string} cloneRequest.newEndpointName Name of new endpoint which will - * created as part of clone job. - * - * @param {object} [cloneRequest.share] Share Object. - * - * @param {string} [cloneRequest.share.description] Description for file share - * - * @param {string} cloneRequest.share.shareStatus The Share Status. Possible - * values include: 'Online', 'Offline' - * - * @param {string} cloneRequest.share.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} cloneRequest.share.adminUser The user/group who will have - * full permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} cloneRequest.share.provisionedCapacityInBytes The total - * provisioned capacity in Bytes - * - * @param {string} cloneRequest.share.monitoringStatus The monitoring status. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [cloneRequest.disk] Disk Object - * - * @param {string} [cloneRequest.disk.description] The description. - * - * @param {string} cloneRequest.disk.diskStatus The disk status. Possible - * values include: 'Online', 'Offline' - * - * @param {array} cloneRequest.disk.accessControlRecords The access control - * records. - * - * @param {string} cloneRequest.disk.dataPolicy The data policy. Possible - * values include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} cloneRequest.disk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} cloneRequest.disk.monitoringStatus The monitoring. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginClone(deviceName: string, backupName: string, elementName: string, cloneRequest: models.CloneRequest, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginClone(deviceName: string, backupName: string, elementName: string, cloneRequest: models.CloneRequest, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginClone(deviceName: string, backupName: string, elementName: string, cloneRequest: models.CloneRequest, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all the backups in a manager. - * - * @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. - */ - listByManagerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the backups in a manager. - * - * @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 {BackupList} - 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. - * - * {BackupList} [result] - The deserialized result object if an error did not occur. - * See {@link BackupList} 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. - */ - listByManagerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByManagerNext(nextPageLink: string, callback: ServiceCallback): void; - listByManagerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all the backups in a device. Can be used to get the backups for - * failover also. - * - * @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. - */ - listByDeviceNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the backups in a device. Can be used to get the backups for - * failover also. - * - * @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 {BackupList} - 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. - * - * {BackupList} [result] - The deserialized result object if an error did not occur. - * See {@link BackupList} 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. - */ - listByDeviceNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDeviceNext(nextPageLink: string, callback: ServiceCallback): void; - listByDeviceNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Devices - * __NOTE__: An instance of this class is automatically created for an - * instance of the StorSimpleManagementClient. - */ -export interface Devices { - - - /** - * Retrieves all the devices in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Specify $expand=details to populate - * additional fields related to the device. - * - * @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. - */ - listByManagerWithHttpOperationResponse(resourceGroupName: string, managerName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the devices in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Specify $expand=details to populate - * additional fields related to the device. - * - * @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 {DeviceList} - 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. - * - * {DeviceList} [result] - The deserialized result object if an error did not occur. - * See {@link DeviceList} 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. - */ - listByManager(resourceGroupName: string, managerName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByManager(resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the properties of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Specify $expand=details to populate - * additional fields related to the device. - * - * @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(deviceName: string, resourceGroupName: string, managerName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the properties of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Specify $expand=details to populate - * additional fields related to the device. - * - * @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 {Device} - 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. - * - * {Device} [result] - The deserialized result object if an error did not occur. - * See {@link Device} 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(deviceName: string, resourceGroupName: string, managerName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - get(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - get(deviceName: string, resourceGroupName: string, managerName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - deleteMethod(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Patches the device. - * - * @param {string} deviceName The device Name. - * - * @param {object} devicePatch Patch representation of the device. - * - * @param {string} [devicePatch.deviceDescription] Short description given for - * the device - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - patchWithHttpOperationResponse(deviceName: string, devicePatch: models.DevicePatch, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Patches the device. - * - * @param {string} deviceName The device Name. - * - * @param {object} devicePatch Patch representation of the device. - * - * @param {string} [devicePatch.deviceDescription] Short description given for - * the device - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {Device} - 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. - * - * {Device} [result] - The deserialized result object if an error did not occur. - * See {@link Device} 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. - */ - patch(deviceName: string, devicePatch: models.DevicePatch, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - patch(deviceName: string, devicePatch: models.DevicePatch, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - patch(deviceName: string, devicePatch: models.DevicePatch, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the alert settings of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - getAlertSettingsWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the alert settings of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {AlertSettings} - 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. - * - * {AlertSettings} [result] - The deserialized result object if an error did not occur. - * See {@link AlertSettings} 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. - */ - getAlertSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getAlertSettings(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - getAlertSettings(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the alert settings - * - * @param {string} deviceName The device name. - * - * @param {object} alertSettings The alert settings. - * - * @param {string} alertSettings.emailNotification Value indicating whether - * user/admins will receive emails when an alert condition occurs on the - * system. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.notificationToServiceOwners Value indicating - * whether service owners will receive emails when an alert condition occurs on - * the system. Applicable only if emailNotification flag is Enabled. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.alertNotificationCulture Culture setting to be - * used while building alert emails. For eg: "en-US" - * - * @param {array} [alertSettings.additionalRecipientEmailList] List of email - * addresses (apart from admin/coadmin of subscription) to whom the alert - * emails need to be sent - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - createOrUpdateAlertSettingsWithHttpOperationResponse(deviceName: string, alertSettings: models.AlertSettings, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the alert settings - * - * @param {string} deviceName The device name. - * - * @param {object} alertSettings The alert settings. - * - * @param {string} alertSettings.emailNotification Value indicating whether - * user/admins will receive emails when an alert condition occurs on the - * system. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.notificationToServiceOwners Value indicating - * whether service owners will receive emails when an alert condition occurs on - * the system. Applicable only if emailNotification flag is Enabled. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.alertNotificationCulture Culture setting to be - * used while building alert emails. For eg: "en-US" - * - * @param {array} [alertSettings.additionalRecipientEmailList] List of email - * addresses (apart from admin/coadmin of subscription) to whom the alert - * emails need to be sent - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {AlertSettings} - 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. - * - * {AlertSettings} [result] - The deserialized result object if an error did not occur. - * See {@link AlertSettings} 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. - */ - createOrUpdateAlertSettings(deviceName: string, alertSettings: models.AlertSettings, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdateAlertSettings(deviceName: string, alertSettings: models.AlertSettings, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - createOrUpdateAlertSettings(deviceName: string, alertSettings: models.AlertSettings, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deactivates the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - deactivateWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deactivates the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - deactivate(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deactivate(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - deactivate(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Downloads udpates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - downloadUpdatesWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Downloads udpates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - downloadUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - downloadUpdates(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - downloadUpdates(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Fails over the device to another device. - * - * @param {string} deviceName The device name. - * - * @param {object} failoverRequest The failover request. - * - * @param {array} [failoverRequest.accesspointIds] - * - * @param {string} [failoverRequest.targetDeviceId] - * - * @param {boolean} [failoverRequest.skipValidation] - * - * @param {boolean} [failoverRequest.keepSourceDevice] - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - failoverWithHttpOperationResponse(deviceName: string, failoverRequest: models.FailoverRequest, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Fails over the device to another device. - * - * @param {string} deviceName The device name. - * - * @param {object} failoverRequest The failover request. - * - * @param {array} [failoverRequest.accesspointIds] - * - * @param {string} [failoverRequest.targetDeviceId] - * - * @param {boolean} [failoverRequest.skipValidation] - * - * @param {boolean} [failoverRequest.keepSourceDevice] - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - failover(deviceName: string, failoverRequest: models.FailoverRequest, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - failover(deviceName: string, failoverRequest: models.FailoverRequest, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - failover(deviceName: string, failoverRequest: models.FailoverRequest, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all the devices which can be used as failover targets for the - * given device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Specify $expand=details to populate - * additional fields related to the device. - * - * @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. - */ - listFailoverTargetWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the devices which can be used as failover targets for the - * given device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.expand] Specify $expand=details to populate - * additional fields related to the device. - * - * @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 {DeviceList} - 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. - * - * {DeviceList} [result] - The deserialized result object if an error did not occur. - * See {@link DeviceList} 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. - */ - listFailoverTarget(deviceName: string, resourceGroupName: string, managerName: string, options?: { expand? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listFailoverTarget(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listFailoverTarget(deviceName: string, resourceGroupName: string, managerName: string, options: { expand? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Installs the updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - installUpdatesWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Installs the updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - installUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - installUpdates(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - installUpdates(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves the device metrics. - * - * @param {string} deviceName The name of the appliance. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listMetricsWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves the device metrics. - * - * @param {string} deviceName The name of the appliance. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {MetricList} - 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. - * - * {MetricList} [result] - The deserialized result object if an error did not occur. - * See {@link MetricList} 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. - */ - listMetrics(deviceName: string, resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listMetrics(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listMetrics(deviceName: string, resourceGroupName: string, managerName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves metric definition of all metrics aggregated at device. - * - * @param {string} deviceName The name of the appliance. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listMetricDefinitionWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves metric definition of all metrics aggregated at device. - * - * @param {string} deviceName The name of the appliance. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {MetricDefinitionList} - 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. - * - * {MetricDefinitionList} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionList} 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. - */ - listMetricDefinition(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetricDefinition(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listMetricDefinition(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the network settings of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - getNetworkSettingsWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the network settings of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {NetworkSettings} - 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. - * - * {NetworkSettings} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkSettings} 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. - */ - getNetworkSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getNetworkSettings(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - getNetworkSettings(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Scans for updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - scanForUpdatesWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Scans for updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - scanForUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - scanForUpdates(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - scanForUpdates(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the security settings. - * - * @param {string} deviceName The device name. - * - * @param {object} securitySettings The security settings. - * - * @param {object} securitySettings.deviceAdminPassword Device administrator - * password as an encrypted string (encrypted using RSA PKCS #1) is used to log - * into the local web UI of the device. Actual password could have at least 8 - * characters that are a combination of uppercase, lowercase, numeric, and - * special characters - * - * @param {string} securitySettings.deviceAdminPassword.value The value of the - * secret itself. If the secret is in plaintext then EncryptionAlgorithm will - * be none and EncryptionCertThumbprint will be null. - * - * @param {string} - * [securitySettings.deviceAdminPassword.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} securitySettings.deviceAdminPassword.encryptionAlgorithm - * Algorithm used to encrypt "Value". Possible values include: 'None', - * 'AES256', 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - createOrUpdateSecuritySettingsWithHttpOperationResponse(deviceName: string, securitySettings: models.SecuritySettings, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the security settings. - * - * @param {string} deviceName The device name. - * - * @param {object} securitySettings The security settings. - * - * @param {object} securitySettings.deviceAdminPassword Device administrator - * password as an encrypted string (encrypted using RSA PKCS #1) is used to log - * into the local web UI of the device. Actual password could have at least 8 - * characters that are a combination of uppercase, lowercase, numeric, and - * special characters - * - * @param {string} securitySettings.deviceAdminPassword.value The value of the - * secret itself. If the secret is in plaintext then EncryptionAlgorithm will - * be none and EncryptionCertThumbprint will be null. - * - * @param {string} - * [securitySettings.deviceAdminPassword.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} securitySettings.deviceAdminPassword.encryptionAlgorithm - * Algorithm used to encrypt "Value". Possible values include: 'None', - * 'AES256', 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - createOrUpdateSecuritySettings(deviceName: string, securitySettings: models.SecuritySettings, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdateSecuritySettings(deviceName: string, securitySettings: models.SecuritySettings, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - createOrUpdateSecuritySettings(deviceName: string, securitySettings: models.SecuritySettings, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the time settings of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - getTimeSettingsWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the time settings of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {TimeSettings} - 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. - * - * {TimeSettings} [result] - The deserialized result object if an error did not occur. - * See {@link TimeSettings} 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. - */ - getTimeSettings(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getTimeSettings(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - getTimeSettings(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the update summary of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - getUpdateSummaryWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the update summary of the specified device name. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {Updates} - 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. - * - * {Updates} [result] - The deserialized result object if an error did not occur. - * See {@link Updates} 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. - */ - getUpdateSummary(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getUpdateSummary(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - getUpdateSummary(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginDeleteMethod(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Patches the device. - * - * @param {string} deviceName The device Name. - * - * @param {object} devicePatch Patch representation of the device. - * - * @param {string} [devicePatch.deviceDescription] Short description given for - * the device - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginPatchWithHttpOperationResponse(deviceName: string, devicePatch: models.DevicePatch, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Patches the device. - * - * @param {string} deviceName The device Name. - * - * @param {object} devicePatch Patch representation of the device. - * - * @param {string} [devicePatch.deviceDescription] Short description given for - * the device - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {Device} - 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. - * - * {Device} [result] - The deserialized result object if an error did not occur. - * See {@link Device} 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. - */ - beginPatch(deviceName: string, devicePatch: models.DevicePatch, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginPatch(deviceName: string, devicePatch: models.DevicePatch, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginPatch(deviceName: string, devicePatch: models.DevicePatch, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the alert settings - * - * @param {string} deviceName The device name. - * - * @param {object} alertSettings The alert settings. - * - * @param {string} alertSettings.emailNotification Value indicating whether - * user/admins will receive emails when an alert condition occurs on the - * system. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.notificationToServiceOwners Value indicating - * whether service owners will receive emails when an alert condition occurs on - * the system. Applicable only if emailNotification flag is Enabled. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.alertNotificationCulture Culture setting to be - * used while building alert emails. For eg: "en-US" - * - * @param {array} [alertSettings.additionalRecipientEmailList] List of email - * addresses (apart from admin/coadmin of subscription) to whom the alert - * emails need to be sent - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateAlertSettingsWithHttpOperationResponse(deviceName: string, alertSettings: models.AlertSettings, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the alert settings - * - * @param {string} deviceName The device name. - * - * @param {object} alertSettings The alert settings. - * - * @param {string} alertSettings.emailNotification Value indicating whether - * user/admins will receive emails when an alert condition occurs on the - * system. Possible values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.notificationToServiceOwners Value indicating - * whether service owners will receive emails when an alert condition occurs on - * the system. Applicable only if emailNotification flag is Enabled. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} alertSettings.alertNotificationCulture Culture setting to be - * used while building alert emails. For eg: "en-US" - * - * @param {array} [alertSettings.additionalRecipientEmailList] List of email - * addresses (apart from admin/coadmin of subscription) to whom the alert - * emails need to be sent - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {AlertSettings} - 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. - * - * {AlertSettings} [result] - The deserialized result object if an error did not occur. - * See {@link AlertSettings} 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. - */ - beginCreateOrUpdateAlertSettings(deviceName: string, alertSettings: models.AlertSettings, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdateAlertSettings(deviceName: string, alertSettings: models.AlertSettings, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginCreateOrUpdateAlertSettings(deviceName: string, alertSettings: models.AlertSettings, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deactivates the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeactivateWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deactivates the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeactivate(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeactivate(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginDeactivate(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Downloads udpates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDownloadUpdatesWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Downloads udpates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDownloadUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDownloadUpdates(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginDownloadUpdates(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Fails over the device to another device. - * - * @param {string} deviceName The device name. - * - * @param {object} failoverRequest The failover request. - * - * @param {array} [failoverRequest.accesspointIds] - * - * @param {string} [failoverRequest.targetDeviceId] - * - * @param {boolean} [failoverRequest.skipValidation] - * - * @param {boolean} [failoverRequest.keepSourceDevice] - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginFailoverWithHttpOperationResponse(deviceName: string, failoverRequest: models.FailoverRequest, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Fails over the device to another device. - * - * @param {string} deviceName The device name. - * - * @param {object} failoverRequest The failover request. - * - * @param {array} [failoverRequest.accesspointIds] - * - * @param {string} [failoverRequest.targetDeviceId] - * - * @param {boolean} [failoverRequest.skipValidation] - * - * @param {boolean} [failoverRequest.keepSourceDevice] - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginFailover(deviceName: string, failoverRequest: models.FailoverRequest, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginFailover(deviceName: string, failoverRequest: models.FailoverRequest, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginFailover(deviceName: string, failoverRequest: models.FailoverRequest, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Installs the updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginInstallUpdatesWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Installs the updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginInstallUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginInstallUpdates(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginInstallUpdates(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Scans for updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginScanForUpdatesWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Scans for updates on the device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginScanForUpdates(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginScanForUpdates(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginScanForUpdates(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the security settings. - * - * @param {string} deviceName The device name. - * - * @param {object} securitySettings The security settings. - * - * @param {object} securitySettings.deviceAdminPassword Device administrator - * password as an encrypted string (encrypted using RSA PKCS #1) is used to log - * into the local web UI of the device. Actual password could have at least 8 - * characters that are a combination of uppercase, lowercase, numeric, and - * special characters - * - * @param {string} securitySettings.deviceAdminPassword.value The value of the - * secret itself. If the secret is in plaintext then EncryptionAlgorithm will - * be none and EncryptionCertThumbprint will be null. - * - * @param {string} - * [securitySettings.deviceAdminPassword.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} securitySettings.deviceAdminPassword.encryptionAlgorithm - * Algorithm used to encrypt "Value". Possible values include: 'None', - * 'AES256', 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateSecuritySettingsWithHttpOperationResponse(deviceName: string, securitySettings: models.SecuritySettings, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the security settings. - * - * @param {string} deviceName The device name. - * - * @param {object} securitySettings The security settings. - * - * @param {object} securitySettings.deviceAdminPassword Device administrator - * password as an encrypted string (encrypted using RSA PKCS #1) is used to log - * into the local web UI of the device. Actual password could have at least 8 - * characters that are a combination of uppercase, lowercase, numeric, and - * special characters - * - * @param {string} securitySettings.deviceAdminPassword.value The value of the - * secret itself. If the secret is in plaintext then EncryptionAlgorithm will - * be none and EncryptionCertThumbprint will be null. - * - * @param {string} - * [securitySettings.deviceAdminPassword.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} securitySettings.deviceAdminPassword.encryptionAlgorithm - * Algorithm used to encrypt "Value". Possible values include: 'None', - * 'AES256', 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateSecuritySettings(deviceName: string, securitySettings: models.SecuritySettings, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdateSecuritySettings(deviceName: string, securitySettings: models.SecuritySettings, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginCreateOrUpdateSecuritySettings(deviceName: string, securitySettings: models.SecuritySettings, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * BackupScheduleGroups - * __NOTE__: An instance of this class is automatically created for an - * instance of the StorSimpleManagementClient. - */ -export interface BackupScheduleGroups { - - - /** - * Retrieves all the backup schedule groups in a device. - * - * @param {string} deviceName The name of the device. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByDeviceWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the backup schedule groups in a device. - * - * @param {string} deviceName The name of the device. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {BackupScheduleGroupList} - 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. - * - * {BackupScheduleGroupList} [result] - The deserialized result object if an error did not occur. - * See {@link BackupScheduleGroupList} 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. - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the properties of the specified backup schedule group name. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the properties of the specified backup schedule group name. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {BackupScheduleGroup} - 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. - * - * {BackupScheduleGroup} [result] - The deserialized result object if an error did not occur. - * See {@link BackupScheduleGroup} 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(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - get(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or Updates the backup schedule Group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {object} scheduleGroup The schedule group to be created - * - * @param {object} scheduleGroup.startTime The start time. When this field is - * specified we will generate Default GrandFather Father Son Backup Schedules. - * - * @param {number} scheduleGroup.startTime.hour The hour. - * - * @param {number} scheduleGroup.startTime.minute The minute. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, scheduleGroupName: string, scheduleGroup: models.BackupScheduleGroup, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or Updates the backup schedule Group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {object} scheduleGroup The schedule group to be created - * - * @param {object} scheduleGroup.startTime The start time. When this field is - * specified we will generate Default GrandFather Father Son Backup Schedules. - * - * @param {number} scheduleGroup.startTime.hour The hour. - * - * @param {number} scheduleGroup.startTime.minute The minute. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {BackupScheduleGroup} - 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. - * - * {BackupScheduleGroup} [result] - The deserialized result object if an error did not occur. - * See {@link BackupScheduleGroup} 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(deviceName: string, scheduleGroupName: string, scheduleGroup: models.BackupScheduleGroup, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(deviceName: string, scheduleGroupName: string, scheduleGroup: models.BackupScheduleGroup, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - createOrUpdate(deviceName: string, scheduleGroupName: string, scheduleGroup: models.BackupScheduleGroup, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the backup schedule group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the backup schedule group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - deleteMethod(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or Updates the backup schedule Group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {object} scheduleGroup The schedule group to be created - * - * @param {object} scheduleGroup.startTime The start time. When this field is - * specified we will generate Default GrandFather Father Son Backup Schedules. - * - * @param {number} scheduleGroup.startTime.hour The hour. - * - * @param {number} scheduleGroup.startTime.minute The minute. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(deviceName: string, scheduleGroupName: string, scheduleGroup: models.BackupScheduleGroup, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or Updates the backup schedule Group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {object} scheduleGroup The schedule group to be created - * - * @param {object} scheduleGroup.startTime The start time. When this field is - * specified we will generate Default GrandFather Father Son Backup Schedules. - * - * @param {number} scheduleGroup.startTime.hour The hour. - * - * @param {number} scheduleGroup.startTime.minute The minute. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {BackupScheduleGroup} - 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. - * - * {BackupScheduleGroup} [result] - The deserialized result object if an error did not occur. - * See {@link BackupScheduleGroup} 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. - */ - beginCreateOrUpdate(deviceName: string, scheduleGroupName: string, scheduleGroup: models.BackupScheduleGroup, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(deviceName: string, scheduleGroupName: string, scheduleGroup: models.BackupScheduleGroup, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginCreateOrUpdate(deviceName: string, scheduleGroupName: string, scheduleGroup: models.BackupScheduleGroup, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the backup schedule group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the backup schedule group. - * - * @param {string} deviceName The name of the device. - * - * @param {string} scheduleGroupName The name of the schedule group. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginDeleteMethod(deviceName: string, scheduleGroupName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * ChapSettingsOperations - * __NOTE__: An instance of this class is automatically created for an - * instance of the StorSimpleManagementClient. - */ -export interface ChapSettingsOperations { - - - /** - * Retrieves all the chap settings in a device. - * - * @param {string} deviceName The name of the device. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByDeviceWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the chap settings in a device. - * - * @param {string} deviceName The name of the device. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ChapSettingsList} - 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. - * - * {ChapSettingsList} [result] - The deserialized result object if an error did not occur. - * See {@link ChapSettingsList} 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. - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the properties of the specified chap setting name. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The user name of chap to be fetched. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the properties of the specified chap setting name. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The user name of chap to be fetched. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ChapSettings} - 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. - * - * {ChapSettings} [result] - The deserialized result object if an error did not occur. - * See {@link ChapSettings} 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(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - get(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {object} chapSetting The chap setting to be added or updated. - * - * @param {object} chapSetting.password The chap password. - * - * @param {string} chapSetting.password.value The value of the secret itself. - * If the secret is in plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. - * - * @param {string} [chapSetting.password.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} chapSetting.password.encryptionAlgorithm Algorithm used to - * encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, chapUserName: string, chapSetting: models.ChapSettings, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {object} chapSetting The chap setting to be added or updated. - * - * @param {object} chapSetting.password The chap password. - * - * @param {string} chapSetting.password.value The value of the secret itself. - * If the secret is in plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. - * - * @param {string} [chapSetting.password.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} chapSetting.password.encryptionAlgorithm Algorithm used to - * encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ChapSettings} - 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. - * - * {ChapSettings} [result] - The deserialized result object if an error did not occur. - * See {@link ChapSettings} 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(deviceName: string, chapUserName: string, chapSetting: models.ChapSettings, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(deviceName: string, chapUserName: string, chapSetting: models.ChapSettings, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - createOrUpdate(deviceName: string, chapUserName: string, chapSetting: models.ChapSettings, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - deleteMethod(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {object} chapSetting The chap setting to be added or updated. - * - * @param {object} chapSetting.password The chap password. - * - * @param {string} chapSetting.password.value The value of the secret itself. - * If the secret is in plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. - * - * @param {string} [chapSetting.password.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} chapSetting.password.encryptionAlgorithm Algorithm used to - * encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(deviceName: string, chapUserName: string, chapSetting: models.ChapSettings, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {object} chapSetting The chap setting to be added or updated. - * - * @param {object} chapSetting.password The chap password. - * - * @param {string} chapSetting.password.value The value of the secret itself. - * If the secret is in plaintext then EncryptionAlgorithm will be none and - * EncryptionCertThumbprint will be null. - * - * @param {string} [chapSetting.password.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} chapSetting.password.encryptionAlgorithm Algorithm used to - * encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ChapSettings} - 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. - * - * {ChapSettings} [result] - The deserialized result object if an error did not occur. - * See {@link ChapSettings} 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. - */ - beginCreateOrUpdate(deviceName: string, chapUserName: string, chapSetting: models.ChapSettings, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(deviceName: string, chapUserName: string, chapSetting: models.ChapSettings, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginCreateOrUpdate(deviceName: string, chapUserName: string, chapSetting: models.ChapSettings, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the chap setting. - * - * @param {string} deviceName The device name. - * - * @param {string} chapUserName The chap user name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginDeleteMethod(deviceName: string, chapUserName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * IscsiDisks - * __NOTE__: An instance of this class is automatically created for an - * instance of the StorSimpleManagementClient. - */ -export interface IscsiDisks { - - - /** - * Retrieves all the iscsi disks in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByDeviceWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the iscsi disks in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIDiskList} - 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. - * - * {ISCSIDiskList} [result] - The deserialized result object if an error did not occur. - * See {@link ISCSIDiskList} 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. - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all the disks in a iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByIscsiServerWithHttpOperationResponse(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the disks in a iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIDiskList} - 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. - * - * {ISCSIDiskList} [result] - The deserialized result object if an error did not occur. - * See {@link ISCSIDiskList} 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. - */ - listByIscsiServer(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByIscsiServer(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByIscsiServer(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the properties of the specified iscsi disk name. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the properties of the specified iscsi disk name. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIDisk} - 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. - * - * {ISCSIDisk} [result] - The deserialized result object if an error did not occur. - * See {@link ISCSIDisk} 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(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - get(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {object} iscsiDisk The iscsi disk. - * - * @param {string} [iscsiDisk.description] The description. - * - * @param {string} iscsiDisk.diskStatus The disk status. Possible values - * include: 'Online', 'Offline' - * - * @param {array} iscsiDisk.accessControlRecords The access control records. - * - * @param {string} iscsiDisk.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} iscsiDisk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} iscsiDisk.monitoringStatus The monitoring. Possible values - * include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, iscsiServerName: string, diskName: string, iscsiDisk: models.ISCSIDisk, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {object} iscsiDisk The iscsi disk. - * - * @param {string} [iscsiDisk.description] The description. - * - * @param {string} iscsiDisk.diskStatus The disk status. Possible values - * include: 'Online', 'Offline' - * - * @param {array} iscsiDisk.accessControlRecords The access control records. - * - * @param {string} iscsiDisk.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} iscsiDisk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} iscsiDisk.monitoringStatus The monitoring. Possible values - * include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIDisk} - 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. - * - * {ISCSIDisk} [result] - The deserialized result object if an error did not occur. - * See {@link ISCSIDisk} 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(deviceName: string, iscsiServerName: string, diskName: string, iscsiDisk: models.ISCSIDisk, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(deviceName: string, iscsiServerName: string, diskName: string, iscsiDisk: models.ISCSIDisk, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - createOrUpdate(deviceName: string, iscsiServerName: string, diskName: string, iscsiDisk: models.ISCSIDisk, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - deleteMethod(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the iscsi disk metrics - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The iscsi disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listMetricsWithHttpOperationResponse(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the iscsi disk metrics - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The iscsi disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {MetricList} - 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. - * - * {MetricList} [result] - The deserialized result object if an error did not occur. - * See {@link MetricList} 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. - */ - listMetrics(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listMetrics(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listMetrics(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves metric definitions for all metric aggregated at the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The iscsi disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listMetricDefinitionWithHttpOperationResponse(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves metric definitions for all metric aggregated at the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The iscsi disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {MetricDefinitionList} - 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. - * - * {MetricDefinitionList} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionList} 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. - */ - listMetricDefinition(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetricDefinition(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listMetricDefinition(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {object} iscsiDisk The iscsi disk. - * - * @param {string} [iscsiDisk.description] The description. - * - * @param {string} iscsiDisk.diskStatus The disk status. Possible values - * include: 'Online', 'Offline' - * - * @param {array} iscsiDisk.accessControlRecords The access control records. - * - * @param {string} iscsiDisk.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} iscsiDisk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} iscsiDisk.monitoringStatus The monitoring. Possible values - * include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(deviceName: string, iscsiServerName: string, diskName: string, iscsiDisk: models.ISCSIDisk, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {object} iscsiDisk The iscsi disk. - * - * @param {string} [iscsiDisk.description] The description. - * - * @param {string} iscsiDisk.diskStatus The disk status. Possible values - * include: 'Online', 'Offline' - * - * @param {array} iscsiDisk.accessControlRecords The access control records. - * - * @param {string} iscsiDisk.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} iscsiDisk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} iscsiDisk.monitoringStatus The monitoring. Possible values - * include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIDisk} - 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. - * - * {ISCSIDisk} [result] - The deserialized result object if an error did not occur. - * See {@link ISCSIDisk} 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. - */ - beginCreateOrUpdate(deviceName: string, iscsiServerName: string, diskName: string, iscsiDisk: models.ISCSIDisk, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(deviceName: string, iscsiServerName: string, diskName: string, iscsiDisk: models.ISCSIDisk, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginCreateOrUpdate(deviceName: string, iscsiServerName: string, diskName: string, iscsiDisk: models.ISCSIDisk, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginDeleteMethod(deviceName: string, iscsiServerName: string, diskName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * FileServers - * __NOTE__: An instance of this class is automatically created for an - * instance of the StorSimpleManagementClient. - */ -export interface FileServers { - - - /** - * Retrieves all the file servers in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByDeviceWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the file servers in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileServerList} - 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. - * - * {FileServerList} [result] - The deserialized result object if an error did not occur. - * See {@link FileServerList} 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. - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the properties of the specified file server name. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the properties of the specified file server name. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileServer} - 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. - * - * {FileServer} [result] - The deserialized result object if an error did not occur. - * See {@link FileServer} 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(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - get(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {object} fileServer The file server. - * - * @param {string} fileServer.domainName Domain of the file server - * - * @param {string} fileServer.storageDomainId The storage domain id. - * - * @param {string} fileServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [fileServer.description] The description of the file server - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, fileServerName: string, fileServer: models.FileServer, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {object} fileServer The file server. - * - * @param {string} fileServer.domainName Domain of the file server - * - * @param {string} fileServer.storageDomainId The storage domain id. - * - * @param {string} fileServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [fileServer.description] The description of the file server - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileServer} - 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. - * - * {FileServer} [result] - The deserialized result object if an error did not occur. - * See {@link FileServer} 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(deviceName: string, fileServerName: string, fileServer: models.FileServer, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(deviceName: string, fileServerName: string, fileServer: models.FileServer, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - createOrUpdate(deviceName: string, fileServerName: string, fileServer: models.FileServer, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - deleteMethod(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Backup the file server now. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - backupNowWithHttpOperationResponse(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Backup the file server now. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - backupNow(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - backupNow(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - backupNow(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the file server metrics. - * - * @param {string} deviceName The name of the device. - * - * @param {string} fileServerName The name of the file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listMetricsWithHttpOperationResponse(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the file server metrics. - * - * @param {string} deviceName The name of the device. - * - * @param {string} fileServerName The name of the file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {MetricList} - 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. - * - * {MetricList} [result] - The deserialized result object if an error did not occur. - * See {@link MetricList} 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. - */ - listMetrics(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listMetrics(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listMetrics(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves metric definitions of all metrics aggregated at the file server. - * - * @param {string} deviceName The name of the device. - * - * @param {string} fileServerName The name of the file server. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listMetricDefinitionWithHttpOperationResponse(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves metric definitions of all metrics aggregated at the file server. - * - * @param {string} deviceName The name of the device. - * - * @param {string} fileServerName The name of the file server. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {MetricDefinitionList} - 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. - * - * {MetricDefinitionList} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionList} 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. - */ - listMetricDefinition(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetricDefinition(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listMetricDefinition(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all the file servers in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByManagerWithHttpOperationResponse(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the file servers in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileServerList} - 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. - * - * {FileServerList} [result] - The deserialized result object if an error did not occur. - * See {@link FileServerList} 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. - */ - listByManager(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByManager(resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {object} fileServer The file server. - * - * @param {string} fileServer.domainName Domain of the file server - * - * @param {string} fileServer.storageDomainId The storage domain id. - * - * @param {string} fileServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [fileServer.description] The description of the file server - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(deviceName: string, fileServerName: string, fileServer: models.FileServer, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {object} fileServer The file server. - * - * @param {string} fileServer.domainName Domain of the file server - * - * @param {string} fileServer.storageDomainId The storage domain id. - * - * @param {string} fileServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [fileServer.description] The description of the file server - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileServer} - 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. - * - * {FileServer} [result] - The deserialized result object if an error did not occur. - * See {@link FileServer} 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. - */ - beginCreateOrUpdate(deviceName: string, fileServerName: string, fileServer: models.FileServer, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(deviceName: string, fileServerName: string, fileServer: models.FileServer, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginCreateOrUpdate(deviceName: string, fileServerName: string, fileServer: models.FileServer, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginDeleteMethod(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Backup the file server now. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginBackupNowWithHttpOperationResponse(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Backup the file server now. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginBackupNow(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginBackupNow(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginBackupNow(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * FileShares - * __NOTE__: An instance of this class is automatically created for an - * instance of the StorSimpleManagementClient. - */ -export interface FileShares { - - - /** - * Retrieves all the file shares in a file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByFileServerWithHttpOperationResponse(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the file shares in a file server. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileShareList} - 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. - * - * {FileShareList} [result] - The deserialized result object if an error did not occur. - * See {@link FileShareList} 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. - */ - listByFileServer(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByFileServer(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByFileServer(deviceName: string, fileServerName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the properties of the specified file share name. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the properties of the specified file share name. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileShare} - 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. - * - * {FileShare} [result] - The deserialized result object if an error did not occur. - * See {@link FileShare} 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(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - get(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {object} fileShare The file share. - * - * @param {string} [fileShare.description] Description for file share - * - * @param {string} fileShare.shareStatus The Share Status. Possible values - * include: 'Online', 'Offline' - * - * @param {string} fileShare.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} fileShare.adminUser The user/group who will have full - * permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} fileShare.provisionedCapacityInBytes The total provisioned - * capacity in Bytes - * - * @param {string} fileShare.monitoringStatus The monitoring status. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, fileServerName: string, shareName: string, fileShare: models.FileShare, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {object} fileShare The file share. - * - * @param {string} [fileShare.description] Description for file share - * - * @param {string} fileShare.shareStatus The Share Status. Possible values - * include: 'Online', 'Offline' - * - * @param {string} fileShare.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} fileShare.adminUser The user/group who will have full - * permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} fileShare.provisionedCapacityInBytes The total provisioned - * capacity in Bytes - * - * @param {string} fileShare.monitoringStatus The monitoring status. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileShare} - 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. - * - * {FileShare} [result] - The deserialized result object if an error did not occur. - * See {@link FileShare} 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(deviceName: string, fileServerName: string, shareName: string, fileShare: models.FileShare, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(deviceName: string, fileServerName: string, shareName: string, fileShare: models.FileShare, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - createOrUpdate(deviceName: string, fileServerName: string, shareName: string, fileShare: models.FileShare, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share Name - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share Name - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - deleteMethod(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the file share metrics - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listMetricsWithHttpOperationResponse(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the file share metrics - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {MetricList} - 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. - * - * {MetricList} [result] - The deserialized result object if an error did not occur. - * See {@link MetricList} 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. - */ - listMetrics(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listMetrics(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listMetrics(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves metric definitions of all metrics aggregated at the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listMetricDefinitionWithHttpOperationResponse(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves metric definitions of all metrics aggregated at the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {MetricDefinitionList} - 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. - * - * {MetricDefinitionList} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionList} 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. - */ - listMetricDefinition(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetricDefinition(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listMetricDefinition(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all the file shares in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByDeviceWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the file shares in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileShareList} - 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. - * - * {FileShareList} [result] - The deserialized result object if an error did not occur. - * See {@link FileShareList} 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. - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {object} fileShare The file share. - * - * @param {string} [fileShare.description] Description for file share - * - * @param {string} fileShare.shareStatus The Share Status. Possible values - * include: 'Online', 'Offline' - * - * @param {string} fileShare.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} fileShare.adminUser The user/group who will have full - * permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} fileShare.provisionedCapacityInBytes The total provisioned - * capacity in Bytes - * - * @param {string} fileShare.monitoringStatus The monitoring status. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(deviceName: string, fileServerName: string, shareName: string, fileShare: models.FileShare, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share name. - * - * @param {object} fileShare The file share. - * - * @param {string} [fileShare.description] Description for file share - * - * @param {string} fileShare.shareStatus The Share Status. Possible values - * include: 'Online', 'Offline' - * - * @param {string} fileShare.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {string} fileShare.adminUser The user/group who will have full - * permission in this share. Active directory email address. Example: - * xyz@contoso.com or Contoso\xyz. - * - * @param {number} fileShare.provisionedCapacityInBytes The total provisioned - * capacity in Bytes - * - * @param {string} fileShare.monitoringStatus The monitoring status. Possible - * values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {FileShare} - 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. - * - * {FileShare} [result] - The deserialized result object if an error did not occur. - * See {@link FileShare} 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. - */ - beginCreateOrUpdate(deviceName: string, fileServerName: string, shareName: string, fileShare: models.FileShare, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(deviceName: string, fileServerName: string, shareName: string, fileShare: models.FileShare, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginCreateOrUpdate(deviceName: string, fileServerName: string, shareName: string, fileShare: models.FileShare, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share Name - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the file share. - * - * @param {string} deviceName The device name. - * - * @param {string} fileServerName The file server name. - * - * @param {string} shareName The file share Name - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginDeleteMethod(deviceName: string, fileServerName: string, shareName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * IscsiServers - * __NOTE__: An instance of this class is automatically created for an - * instance of the StorSimpleManagementClient. - */ -export interface IscsiServers { - - - /** - * Retrieves all the iscsi in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByDeviceWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the iscsi in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIServerList} - 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. - * - * {ISCSIServerList} [result] - The deserialized result object if an error did not occur. - * See {@link ISCSIServerList} 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. - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the properties of the specified iscsi server name. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the properties of the specified iscsi server name. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIServer} - 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. - * - * {ISCSIServer} [result] - The deserialized result object if an error did not occur. - * See {@link ISCSIServer} 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(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - get(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {object} iscsiServer The iscsi server. - * - * @param {string} iscsiServer.storageDomainId The storage domain id. - * - * @param {string} iscsiServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [iscsiServer.description] The description. - * - * @param {string} [iscsiServer.chapId] The chap id. - * - * @param {string} [iscsiServer.reverseChapId] The reverse chap id. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, iscsiServerName: string, iscsiServer: models.ISCSIServer, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {object} iscsiServer The iscsi server. - * - * @param {string} iscsiServer.storageDomainId The storage domain id. - * - * @param {string} iscsiServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [iscsiServer.description] The description. - * - * @param {string} [iscsiServer.chapId] The chap id. - * - * @param {string} [iscsiServer.reverseChapId] The reverse chap id. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIServer} - 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. - * - * {ISCSIServer} [result] - The deserialized result object if an error did not occur. - * See {@link ISCSIServer} 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(deviceName: string, iscsiServerName: string, iscsiServer: models.ISCSIServer, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(deviceName: string, iscsiServerName: string, iscsiServer: models.ISCSIServer, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - createOrUpdate(deviceName: string, iscsiServerName: string, iscsiServer: models.ISCSIServer, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - deleteMethod(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Backup the iscsi server now. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - backupNowWithHttpOperationResponse(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Backup the iscsi server now. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - backupNow(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - backupNow(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - backupNow(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Gets the iscsi server metrics - * - * @param {string} deviceName The devie name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listMetricsWithHttpOperationResponse(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Gets the iscsi server metrics - * - * @param {string} deviceName The devie name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {MetricList} - 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. - * - * {MetricList} [result] - The deserialized result object if an error did not occur. - * See {@link MetricList} 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. - */ - listMetrics(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listMetrics(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listMetrics(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves metric definitions for all metrics aggregated at iscsi server. - * - * @param {string} deviceName The devie name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listMetricDefinitionWithHttpOperationResponse(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves metric definitions for all metrics aggregated at iscsi server. - * - * @param {string} deviceName The devie name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {MetricDefinitionList} - 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. - * - * {MetricDefinitionList} [result] - The deserialized result object if an error did not occur. - * See {@link MetricDefinitionList} 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. - */ - listMetricDefinition(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetricDefinition(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listMetricDefinition(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all the iscsi servers in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByManagerWithHttpOperationResponse(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the iscsi servers in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIServerList} - 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. - * - * {ISCSIServerList} [result] - The deserialized result object if an error did not occur. - * See {@link ISCSIServerList} 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. - */ - listByManager(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByManager(resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {object} iscsiServer The iscsi server. - * - * @param {string} iscsiServer.storageDomainId The storage domain id. - * - * @param {string} iscsiServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [iscsiServer.description] The description. - * - * @param {string} [iscsiServer.chapId] The chap id. - * - * @param {string} [iscsiServer.reverseChapId] The reverse chap id. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(deviceName: string, iscsiServerName: string, iscsiServer: models.ISCSIServer, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {object} iscsiServer The iscsi server. - * - * @param {string} iscsiServer.storageDomainId The storage domain id. - * - * @param {string} iscsiServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [iscsiServer.description] The description. - * - * @param {string} [iscsiServer.chapId] The chap id. - * - * @param {string} [iscsiServer.reverseChapId] The reverse chap id. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIServer} - 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. - * - * {ISCSIServer} [result] - The deserialized result object if an error did not occur. - * See {@link ISCSIServer} 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. - */ - beginCreateOrUpdate(deviceName: string, iscsiServerName: string, iscsiServer: models.ISCSIServer, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(deviceName: string, iscsiServerName: string, iscsiServer: models.ISCSIServer, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginCreateOrUpdate(deviceName: string, iscsiServerName: string, iscsiServer: models.ISCSIServer, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginDeleteMethod(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Backup the iscsi server now. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginBackupNowWithHttpOperationResponse(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Backup the iscsi server now. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginBackupNow(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginBackupNow(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginBackupNow(deviceName: string, iscsiServerName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Jobs - * __NOTE__: An instance of this class is automatically created for an - * instance of the StorSimpleManagementClient. - */ -export interface Jobs { - - - /** - * Retrieves all the jobs in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listByDeviceWithHttpOperationResponse(deviceName: string, resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the jobs in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {JobList} - 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. - * - * {JobList} [result] - The deserialized result object if an error did not occur. - * See {@link JobList} 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. - */ - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByDevice(deviceName: string, resourceGroupName: string, managerName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the properties of the specified job name. - * - * @param {string} deviceName The device name. - * - * @param {string} jobName The job name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName: string, jobName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the properties of the specified job name. - * - * @param {string} deviceName The device name. - * - * @param {string} jobName The job name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {Job} - 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. - * - * {Job} [result] - The deserialized result object if an error did not occur. - * See {@link Job} 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(deviceName: string, jobName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(deviceName: string, jobName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - get(deviceName: string, jobName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all the jobs in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listByManagerWithHttpOperationResponse(resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the jobs in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {JobList} - 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. - * - * {JobList} [result] - The deserialized result object if an error did not occur. - * See {@link JobList} 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. - */ - listByManager(resourceGroupName: string, managerName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listByManager(resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all the jobs in a device. - * - * @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. - */ - listByDeviceNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the jobs in a device. - * - * @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 {JobList} - 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. - * - * {JobList} [result] - The deserialized result object if an error did not occur. - * See {@link JobList} 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. - */ - listByDeviceNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByDeviceNext(nextPageLink: string, callback: ServiceCallback): void; - listByDeviceNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Retrieves all the jobs in a manager. - * - * @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. - */ - listByManagerNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the jobs in a manager. - * - * @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 {JobList} - 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. - * - * {JobList} [result] - The deserialized result object if an error did not occur. - * See {@link JobList} 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. - */ - listByManagerNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByManagerNext(nextPageLink: string, callback: ServiceCallback): void; - listByManagerNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * StorageAccountCredentials - * __NOTE__: An instance of this class is automatically created for an - * instance of the StorSimpleManagementClient. - */ -export interface StorageAccountCredentials { - - - /** - * Retrieves all the storage account credentials in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByManagerWithHttpOperationResponse(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the storage account credentials in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {StorageAccountCredentialList} - 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. - * - * {StorageAccountCredentialList} [result] - The deserialized result object if an error did not occur. - * See {@link StorageAccountCredentialList} 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. - */ - listByManager(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByManager(resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the properties of the specified storage account credential name. - * - * @param {string} credentialName The name of storage account credential to be - * fetched. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(credentialName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the properties of the specified storage account credential name. - * - * @param {string} credentialName The name of storage account credential to be - * fetched. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {StorageAccountCredential} - 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. - * - * {StorageAccountCredential} [result] - The deserialized result object if an error did not occur. - * See {@link StorageAccountCredential} 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(credentialName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(credentialName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - get(credentialName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the storage account credential - * - * @param {string} credentialName The credential name. - * - * @param {object} storageAccount The storage account credential to be added or - * updated. - * - * @param {string} storageAccount.cloudType The cloud service provider. - * Possible values include: 'Azure', 'S3', 'S3_RRS', 'OpenStack', 'HP' - * - * @param {string} storageAccount.endPoint The storage endpoint - * - * @param {string} storageAccount.login The storage account login - * - * @param {string} [storageAccount.location] The storage account's geo location - * - * @param {string} storageAccount.enableSSL SSL needs to be enabled or not. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [storageAccount.accessKey] The details of the storage - * account password - * - * @param {string} storageAccount.accessKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} [storageAccount.accessKey.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} storageAccount.accessKey.encryptionAlgorithm Algorithm used - * to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(credentialName: string, storageAccount: models.StorageAccountCredential, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the storage account credential - * - * @param {string} credentialName The credential name. - * - * @param {object} storageAccount The storage account credential to be added or - * updated. - * - * @param {string} storageAccount.cloudType The cloud service provider. - * Possible values include: 'Azure', 'S3', 'S3_RRS', 'OpenStack', 'HP' - * - * @param {string} storageAccount.endPoint The storage endpoint - * - * @param {string} storageAccount.login The storage account login - * - * @param {string} [storageAccount.location] The storage account's geo location - * - * @param {string} storageAccount.enableSSL SSL needs to be enabled or not. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [storageAccount.accessKey] The details of the storage - * account password - * - * @param {string} storageAccount.accessKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} [storageAccount.accessKey.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} storageAccount.accessKey.encryptionAlgorithm Algorithm used - * to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {StorageAccountCredential} - 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. - * - * {StorageAccountCredential} [result] - The deserialized result object if an error did not occur. - * See {@link StorageAccountCredential} 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(credentialName: string, storageAccount: models.StorageAccountCredential, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(credentialName: string, storageAccount: models.StorageAccountCredential, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - createOrUpdate(credentialName: string, storageAccount: models.StorageAccountCredential, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the storage account credential - * - * @param {string} credentialName The name of the storage account credential. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(credentialName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the storage account credential - * - * @param {string} credentialName The name of the storage account credential. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(credentialName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(credentialName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - deleteMethod(credentialName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the storage account credential - * - * @param {string} credentialName The credential name. - * - * @param {object} storageAccount The storage account credential to be added or - * updated. - * - * @param {string} storageAccount.cloudType The cloud service provider. - * Possible values include: 'Azure', 'S3', 'S3_RRS', 'OpenStack', 'HP' - * - * @param {string} storageAccount.endPoint The storage endpoint - * - * @param {string} storageAccount.login The storage account login - * - * @param {string} [storageAccount.location] The storage account's geo location - * - * @param {string} storageAccount.enableSSL SSL needs to be enabled or not. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [storageAccount.accessKey] The details of the storage - * account password - * - * @param {string} storageAccount.accessKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} [storageAccount.accessKey.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} storageAccount.accessKey.encryptionAlgorithm Algorithm used - * to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(credentialName: string, storageAccount: models.StorageAccountCredential, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the storage account credential - * - * @param {string} credentialName The credential name. - * - * @param {object} storageAccount The storage account credential to be added or - * updated. - * - * @param {string} storageAccount.cloudType The cloud service provider. - * Possible values include: 'Azure', 'S3', 'S3_RRS', 'OpenStack', 'HP' - * - * @param {string} storageAccount.endPoint The storage endpoint - * - * @param {string} storageAccount.login The storage account login - * - * @param {string} [storageAccount.location] The storage account's geo location - * - * @param {string} storageAccount.enableSSL SSL needs to be enabled or not. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [storageAccount.accessKey] The details of the storage - * account password - * - * @param {string} storageAccount.accessKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} [storageAccount.accessKey.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} storageAccount.accessKey.encryptionAlgorithm Algorithm used - * to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {StorageAccountCredential} - 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. - * - * {StorageAccountCredential} [result] - The deserialized result object if an error did not occur. - * See {@link StorageAccountCredential} 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. - */ - beginCreateOrUpdate(credentialName: string, storageAccount: models.StorageAccountCredential, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(credentialName: string, storageAccount: models.StorageAccountCredential, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginCreateOrUpdate(credentialName: string, storageAccount: models.StorageAccountCredential, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the storage account credential - * - * @param {string} credentialName The name of the storage account credential. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(credentialName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the storage account credential - * - * @param {string} credentialName The name of the storage account credential. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(credentialName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(credentialName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginDeleteMethod(credentialName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * StorageDomains - * __NOTE__: An instance of this class is automatically created for an - * instance of the StorSimpleManagementClient. - */ -export interface StorageDomains { - - - /** - * Retrieves all the storage domains in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByManagerWithHttpOperationResponse(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Retrieves all the storage domains in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {StorageDomainList} - 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. - * - * {StorageDomainList} [result] - The deserialized result object if an error did not occur. - * See {@link StorageDomainList} 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. - */ - listByManager(resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listByManager(resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - listByManager(resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns the properties of the specified storage domain name. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(storageDomainName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns the properties of the specified storage domain name. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {StorageDomain} - 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. - * - * {StorageDomain} [result] - The deserialized result object if an error did not occur. - * See {@link StorageDomain} 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(storageDomainName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(storageDomainName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - get(storageDomainName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {object} storageDomain The storageDomain. - * - * @param {array} storageDomain.storageAccountCredentialIds The storage account - * credentials. - * - * @param {object} [storageDomain.encryptionKey] The encryption key used to - * encrypt the data. This is a user secret. - * - * @param {string} storageDomain.encryptionKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} - * [storageDomain.encryptionKey.encryptionCertificateThumbprint] Thumbprint - * certificate that was used to encrypt "Value" - * - * @param {string} storageDomain.encryptionKey.encryptionAlgorithm Algorithm - * used to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} storageDomain.encryptionStatus The encryption status - * "Enabled | Disabled". Possible values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(storageDomainName: string, storageDomain: models.StorageDomain, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {object} storageDomain The storageDomain. - * - * @param {array} storageDomain.storageAccountCredentialIds The storage account - * credentials. - * - * @param {object} [storageDomain.encryptionKey] The encryption key used to - * encrypt the data. This is a user secret. - * - * @param {string} storageDomain.encryptionKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} - * [storageDomain.encryptionKey.encryptionCertificateThumbprint] Thumbprint - * certificate that was used to encrypt "Value" - * - * @param {string} storageDomain.encryptionKey.encryptionAlgorithm Algorithm - * used to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} storageDomain.encryptionStatus The encryption status - * "Enabled | Disabled". Possible values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {StorageDomain} - 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. - * - * {StorageDomain} [result] - The deserialized result object if an error did not occur. - * See {@link StorageDomain} 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(storageDomainName: string, storageDomain: models.StorageDomain, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(storageDomainName: string, storageDomain: models.StorageDomain, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - createOrUpdate(storageDomainName: string, storageDomain: models.StorageDomain, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(storageDomainName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(storageDomainName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(storageDomainName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - deleteMethod(storageDomainName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Creates or updates the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {object} storageDomain The storageDomain. - * - * @param {array} storageDomain.storageAccountCredentialIds The storage account - * credentials. - * - * @param {object} [storageDomain.encryptionKey] The encryption key used to - * encrypt the data. This is a user secret. - * - * @param {string} storageDomain.encryptionKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} - * [storageDomain.encryptionKey.encryptionCertificateThumbprint] Thumbprint - * certificate that was used to encrypt "Value" - * - * @param {string} storageDomain.encryptionKey.encryptionAlgorithm Algorithm - * used to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} storageDomain.encryptionStatus The encryption status - * "Enabled | Disabled". Possible values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(storageDomainName: string, storageDomain: models.StorageDomain, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Creates or updates the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {object} storageDomain The storageDomain. - * - * @param {array} storageDomain.storageAccountCredentialIds The storage account - * credentials. - * - * @param {object} [storageDomain.encryptionKey] The encryption key used to - * encrypt the data. This is a user secret. - * - * @param {string} storageDomain.encryptionKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} - * [storageDomain.encryptionKey.encryptionCertificateThumbprint] Thumbprint - * certificate that was used to encrypt "Value" - * - * @param {string} storageDomain.encryptionKey.encryptionAlgorithm Algorithm - * used to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} storageDomain.encryptionStatus The encryption status - * "Enabled | Disabled". Possible values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {StorageDomain} - 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. - * - * {StorageDomain} [result] - The deserialized result object if an error did not occur. - * See {@link StorageDomain} 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. - */ - beginCreateOrUpdate(storageDomainName: string, storageDomain: models.StorageDomain, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(storageDomainName: string, storageDomain: models.StorageDomain, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginCreateOrUpdate(storageDomainName: string, storageDomain: models.StorageDomain, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Deletes the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(storageDomainName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Deletes the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(storageDomainName: string, resourceGroupName: string, managerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginDeleteMethod(storageDomainName: string, resourceGroupName: string, managerName: string, callback: ServiceCallback): void; - beginDeleteMethod(storageDomainName: string, resourceGroupName: string, managerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} diff --git a/lib/services/storSimple1200Series/lib/operations/index.js b/lib/services/storSimple1200Series/lib/operations/index.js deleted file mode 100644 index a270377fa3..0000000000 --- a/lib/services/storSimple1200Series/lib/operations/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -/* jshint latedef:false */ -/* jshint forin:false */ -/* jshint noempty:false */ - -'use strict'; - -exports.Managers = require('./managers'); -exports.AvailableProviderOperationsOperations = require('./availableProviderOperationsOperations'); -exports.AccessControlRecords = require('./accessControlRecords'); -exports.Alerts = require('./alerts'); -exports.Backups = require('./backups'); -exports.Devices = require('./devices'); -exports.BackupScheduleGroups = require('./backupScheduleGroups'); -exports.ChapSettingsOperations = require('./chapSettingsOperations'); -exports.IscsiDisks = require('./iscsiDisks'); -exports.FileServers = require('./fileServers'); -exports.FileShares = require('./fileShares'); -exports.IscsiServers = require('./iscsiServers'); -exports.Jobs = require('./jobs'); -exports.StorageAccountCredentials = require('./storageAccountCredentials'); -exports.StorageDomains = require('./storageDomains'); diff --git a/lib/services/storSimple1200Series/lib/operations/iscsiDisks.js b/lib/services/storSimple1200Series/lib/operations/iscsiDisks.js deleted file mode 100644 index 37a30b366b..0000000000 --- a/lib/services/storSimple1200Series/lib/operations/iscsiDisks.js +++ /dev/null @@ -1,2379 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * Retrieves all the iscsi disks in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 ISCSIDiskList} 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 _listByDevice(deviceName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/disks'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ISCSIDiskList']().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); - }); -} - -/** - * Retrieves all the disks in a iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 ISCSIDiskList} 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 _listByIscsiServer(deviceName, iscsiServerName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (iscsiServerName === null || iscsiServerName === undefined || typeof iscsiServerName.valueOf() !== 'string') { - throw new Error('iscsiServerName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{iscsiServerName}', encodeURIComponent(iscsiServerName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ISCSIDiskList']().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); - }); -} - -/** - * Returns the properties of the specified iscsi disk name. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 ISCSIDisk} 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(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (iscsiServerName === null || iscsiServerName === undefined || typeof iscsiServerName.valueOf() !== 'string') { - throw new Error('iscsiServerName cannot be null or undefined and it must be of type string.'); - } - if (diskName === null || diskName === undefined || typeof diskName.valueOf() !== 'string') { - throw new Error('diskName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{iscsiServerName}', encodeURIComponent(iscsiServerName)); - requestUrl = requestUrl.replace('{diskName}', encodeURIComponent(diskName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ISCSIDisk']().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); - }); -} - - -/** - * Creates or updates the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {object} iscsiDisk The iscsi disk. - * - * @param {string} [iscsiDisk.description] The description. - * - * @param {string} iscsiDisk.diskStatus The disk status. Possible values - * include: 'Online', 'Offline' - * - * @param {array} iscsiDisk.accessControlRecords The access control records. - * - * @param {string} iscsiDisk.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} iscsiDisk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} iscsiDisk.monitoringStatus The monitoring. Possible values - * include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 ISCSIDisk} 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(deviceName, iscsiServerName, diskName, iscsiDisk, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginCreateOrUpdate(deviceName, iscsiServerName, diskName, iscsiDisk, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ISCSIDisk']().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 the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginDeleteMethod(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the iscsi disk metrics - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The iscsi disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 MetricList} 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 _listMetrics(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, 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.'); - } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - // Validate - try { - if (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (iscsiServerName === null || iscsiServerName === undefined || typeof iscsiServerName.valueOf() !== 'string') { - throw new Error('iscsiServerName cannot be null or undefined and it must be of type string.'); - } - if (diskName === null || diskName === undefined || typeof diskName.valueOf() !== 'string') { - throw new Error('diskName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter 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.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}/metrics'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{iscsiServerName}', encodeURIComponent(iscsiServerName)); - requestUrl = requestUrl.replace('{diskName}', encodeURIComponent(diskName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['MetricList']().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); - }); -} - -/** - * Retrieves metric definitions for all metric aggregated at the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The iscsi disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 MetricDefinitionList} 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 _listMetricDefinition(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (iscsiServerName === null || iscsiServerName === undefined || typeof iscsiServerName.valueOf() !== 'string') { - throw new Error('iscsiServerName cannot be null or undefined and it must be of type string.'); - } - if (diskName === null || diskName === undefined || typeof diskName.valueOf() !== 'string') { - throw new Error('diskName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}/metricsDefinitions'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{iscsiServerName}', encodeURIComponent(iscsiServerName)); - requestUrl = requestUrl.replace('{diskName}', encodeURIComponent(diskName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['MetricDefinitionList']().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); - }); -} - -/** - * Creates or updates the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {object} iscsiDisk The iscsi disk. - * - * @param {string} [iscsiDisk.description] The description. - * - * @param {string} iscsiDisk.diskStatus The disk status. Possible values - * include: 'Online', 'Offline' - * - * @param {array} iscsiDisk.accessControlRecords The access control records. - * - * @param {string} iscsiDisk.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} iscsiDisk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} iscsiDisk.monitoringStatus The monitoring. Possible values - * include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 ISCSIDisk} 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 _beginCreateOrUpdate(deviceName, iscsiServerName, diskName, iscsiDisk, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (iscsiServerName === null || iscsiServerName === undefined || typeof iscsiServerName.valueOf() !== 'string') { - throw new Error('iscsiServerName cannot be null or undefined and it must be of type string.'); - } - if (diskName === null || diskName === undefined || typeof diskName.valueOf() !== 'string') { - throw new Error('diskName cannot be null or undefined and it must be of type string.'); - } - if (iscsiDisk === null || iscsiDisk === undefined) { - throw new Error('iscsiDisk cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{iscsiServerName}', encodeURIComponent(iscsiServerName)); - requestUrl = requestUrl.replace('{diskName}', encodeURIComponent(diskName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 (iscsiDisk !== null && iscsiDisk !== undefined) { - let requestModelMapper = new client.models['ISCSIDisk']().mapper(); - requestModel = client.serialize(requestModelMapper, iscsiDisk, 'iscsiDisk'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(iscsiDisk, 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 !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ISCSIDisk']().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 the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginDeleteMethod(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (iscsiServerName === null || iscsiServerName === undefined || typeof iscsiServerName.valueOf() !== 'string') { - throw new Error('iscsiServerName cannot be null or undefined and it must be of type string.'); - } - if (diskName === null || diskName === undefined || typeof diskName.valueOf() !== 'string') { - throw new Error('diskName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/disks/{diskName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{iscsiServerName}', encodeURIComponent(iscsiServerName)); - requestUrl = requestUrl.replace('{diskName}', encodeURIComponent(diskName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** Class representing a IscsiDisks. */ -class IscsiDisks { - /** - * Create a IscsiDisks. - * @param {StorSimpleManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listByDevice = _listByDevice; - this._listByIscsiServer = _listByIscsiServer; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._deleteMethod = _deleteMethod; - this._listMetrics = _listMetrics; - this._listMetricDefinition = _listMetricDefinition; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - } - - /** - * Retrieves all the iscsi disks in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByDeviceWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByDevice(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the iscsi disks in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIDiskList} - 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 ISCSIDiskList} 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. - */ - listByDevice(deviceName, resourceGroupName, managerName, 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._listByDevice(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByDevice(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Retrieves all the disks in a iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByIscsiServerWithHttpOperationResponse(deviceName, iscsiServerName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByIscsiServer(deviceName, iscsiServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the disks in a iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIDiskList} - 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 ISCSIDiskList} 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. - */ - listByIscsiServer(deviceName, iscsiServerName, resourceGroupName, managerName, 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._listByIscsiServer(deviceName, iscsiServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByIscsiServer(deviceName, iscsiServerName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Returns the properties of the specified iscsi disk name. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the properties of the specified iscsi disk name. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIDisk} - 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 ISCSIDisk} 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(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, 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(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {object} iscsiDisk The iscsi disk. - * - * @param {string} [iscsiDisk.description] The description. - * - * @param {string} iscsiDisk.diskStatus The disk status. Possible values - * include: 'Online', 'Offline' - * - * @param {array} iscsiDisk.accessControlRecords The access control records. - * - * @param {string} iscsiDisk.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} iscsiDisk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} iscsiDisk.monitoringStatus The monitoring. Possible values - * include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, iscsiServerName, diskName, iscsiDisk, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(deviceName, iscsiServerName, diskName, iscsiDisk, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {object} iscsiDisk The iscsi disk. - * - * @param {string} [iscsiDisk.description] The description. - * - * @param {string} iscsiDisk.diskStatus The disk status. Possible values - * include: 'Online', 'Offline' - * - * @param {array} iscsiDisk.accessControlRecords The access control records. - * - * @param {string} iscsiDisk.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} iscsiDisk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} iscsiDisk.monitoringStatus The monitoring. Possible values - * include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIDisk} - 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 ISCSIDisk} 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(deviceName, iscsiServerName, diskName, iscsiDisk, resourceGroupName, managerName, 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(deviceName, iscsiServerName, diskName, iscsiDisk, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(deviceName, iscsiServerName, diskName, iscsiDisk, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, 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(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Gets the iscsi disk metrics - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The iscsi disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listMetricsWithHttpOperationResponse(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetrics(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, 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 iscsi disk metrics - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The iscsi disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {MetricList} - 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 MetricList} 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. - */ - listMetrics(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, 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._listMetrics(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetrics(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Retrieves metric definitions for all metric aggregated at the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The iscsi disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listMetricDefinitionWithHttpOperationResponse(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetricDefinition(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves metric definitions for all metric aggregated at the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The iscsi disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {MetricDefinitionList} - 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 MetricDefinitionList} 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. - */ - listMetricDefinition(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, 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._listMetricDefinition(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetricDefinition(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {object} iscsiDisk The iscsi disk. - * - * @param {string} [iscsiDisk.description] The description. - * - * @param {string} iscsiDisk.diskStatus The disk status. Possible values - * include: 'Online', 'Offline' - * - * @param {array} iscsiDisk.accessControlRecords The access control records. - * - * @param {string} iscsiDisk.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} iscsiDisk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} iscsiDisk.monitoringStatus The monitoring. Possible values - * include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(deviceName, iscsiServerName, diskName, iscsiDisk, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(deviceName, iscsiServerName, diskName, iscsiDisk, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {object} iscsiDisk The iscsi disk. - * - * @param {string} [iscsiDisk.description] The description. - * - * @param {string} iscsiDisk.diskStatus The disk status. Possible values - * include: 'Online', 'Offline' - * - * @param {array} iscsiDisk.accessControlRecords The access control records. - * - * @param {string} iscsiDisk.dataPolicy The data policy. Possible values - * include: 'Invalid', 'Local', 'Tiered', 'Cloud' - * - * @param {number} iscsiDisk.provisionedCapacityInBytes The provisioned - * capacity in bytes. - * - * @param {string} iscsiDisk.monitoringStatus The monitoring. Possible values - * include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIDisk} - 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 ISCSIDisk} 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. - */ - beginCreateOrUpdate(deviceName, iscsiServerName, diskName, iscsiDisk, resourceGroupName, managerName, 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._beginCreateOrUpdate(deviceName, iscsiServerName, diskName, iscsiDisk, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(deviceName, iscsiServerName, diskName, iscsiDisk, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the iscsi disk. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} diskName The disk name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, 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._beginDeleteMethod(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(deviceName, iscsiServerName, diskName, resourceGroupName, managerName, options, optionalCallback); - } - } - -} - -module.exports = IscsiDisks; diff --git a/lib/services/storSimple1200Series/lib/operations/iscsiServers.js b/lib/services/storSimple1200Series/lib/operations/iscsiServers.js deleted file mode 100644 index e0188fbd41..0000000000 --- a/lib/services/storSimple1200Series/lib/operations/iscsiServers.js +++ /dev/null @@ -1,2666 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * Retrieves all the iscsi in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 ISCSIServerList} 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 _listByDevice(deviceName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ISCSIServerList']().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); - }); -} - -/** - * Returns the properties of the specified iscsi server name. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 ISCSIServer} 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(deviceName, iscsiServerName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (iscsiServerName === null || iscsiServerName === undefined || typeof iscsiServerName.valueOf() !== 'string') { - throw new Error('iscsiServerName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{iscsiServerName}', encodeURIComponent(iscsiServerName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ISCSIServer']().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); - }); -} - - -/** - * Creates or updates the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {object} iscsiServer The iscsi server. - * - * @param {string} iscsiServer.storageDomainId The storage domain id. - * - * @param {string} iscsiServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [iscsiServer.description] The description. - * - * @param {string} [iscsiServer.chapId] The chap id. - * - * @param {string} [iscsiServer.reverseChapId] The reverse chap id. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 ISCSIServer} 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(deviceName, iscsiServerName, iscsiServer, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginCreateOrUpdate(deviceName, iscsiServerName, iscsiServer, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ISCSIServer']().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 the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, iscsiServerName, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginDeleteMethod(deviceName, iscsiServerName, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - - -/** - * Backup the iscsi server now. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _backupNow(deviceName, iscsiServerName, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginBackupNow(deviceName, iscsiServerName, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Gets the iscsi server metrics - * - * @param {string} deviceName The devie name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 MetricList} 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 _listMetrics(deviceName, iscsiServerName, resourceGroupName, managerName, 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.'); - } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - // Validate - try { - if (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (iscsiServerName === null || iscsiServerName === undefined || typeof iscsiServerName.valueOf() !== 'string') { - throw new Error('iscsiServerName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter 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.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/metrics'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{iscsiServerName}', encodeURIComponent(iscsiServerName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['MetricList']().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); - }); -} - -/** - * Retrieves metric definitions for all metrics aggregated at iscsi server. - * - * @param {string} deviceName The devie name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 MetricDefinitionList} 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 _listMetricDefinition(deviceName, iscsiServerName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (iscsiServerName === null || iscsiServerName === undefined || typeof iscsiServerName.valueOf() !== 'string') { - throw new Error('iscsiServerName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/metricsDefinitions'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{iscsiServerName}', encodeURIComponent(iscsiServerName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['MetricDefinitionList']().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); - }); -} - -/** - * Retrieves all the iscsi servers in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 ISCSIServerList} 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 _listByManager(resourceGroupName, managerName, 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.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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/iscsiservers'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ISCSIServerList']().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); - }); -} - -/** - * Creates or updates the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {object} iscsiServer The iscsi server. - * - * @param {string} iscsiServer.storageDomainId The storage domain id. - * - * @param {string} iscsiServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [iscsiServer.description] The description. - * - * @param {string} [iscsiServer.chapId] The chap id. - * - * @param {string} [iscsiServer.reverseChapId] The reverse chap id. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 ISCSIServer} 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 _beginCreateOrUpdate(deviceName, iscsiServerName, iscsiServer, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (iscsiServerName === null || iscsiServerName === undefined || typeof iscsiServerName.valueOf() !== 'string') { - throw new Error('iscsiServerName cannot be null or undefined and it must be of type string.'); - } - if (iscsiServer === null || iscsiServer === undefined) { - throw new Error('iscsiServer cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{iscsiServerName}', encodeURIComponent(iscsiServerName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 (iscsiServer !== null && iscsiServer !== undefined) { - let requestModelMapper = new client.models['ISCSIServer']().mapper(); - requestModel = client.serialize(requestModelMapper, iscsiServer, 'iscsiServer'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(iscsiServer, 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 !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ISCSIServer']().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 the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginDeleteMethod(deviceName, iscsiServerName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (iscsiServerName === null || iscsiServerName === undefined || typeof iscsiServerName.valueOf() !== 'string') { - throw new Error('iscsiServerName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{iscsiServerName}', encodeURIComponent(iscsiServerName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** - * Backup the iscsi server now. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginBackupNow(deviceName, iscsiServerName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (iscsiServerName === null || iscsiServerName === undefined || typeof iscsiServerName.valueOf() !== 'string') { - throw new Error('iscsiServerName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/iscsiservers/{iscsiServerName}/backup'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{iscsiServerName}', encodeURIComponent(iscsiServerName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** Class representing a IscsiServers. */ -class IscsiServers { - /** - * Create a IscsiServers. - * @param {StorSimpleManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listByDevice = _listByDevice; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._deleteMethod = _deleteMethod; - this._backupNow = _backupNow; - this._listMetrics = _listMetrics; - this._listMetricDefinition = _listMetricDefinition; - this._listByManager = _listByManager; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginBackupNow = _beginBackupNow; - } - - /** - * Retrieves all the iscsi in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByDeviceWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByDevice(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the iscsi in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIServerList} - 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 ISCSIServerList} 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. - */ - listByDevice(deviceName, resourceGroupName, managerName, 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._listByDevice(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByDevice(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Returns the properties of the specified iscsi server name. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, iscsiServerName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(deviceName, iscsiServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the properties of the specified iscsi server name. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIServer} - 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 ISCSIServer} 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(deviceName, iscsiServerName, resourceGroupName, managerName, 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(deviceName, iscsiServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(deviceName, iscsiServerName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {object} iscsiServer The iscsi server. - * - * @param {string} iscsiServer.storageDomainId The storage domain id. - * - * @param {string} iscsiServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [iscsiServer.description] The description. - * - * @param {string} [iscsiServer.chapId] The chap id. - * - * @param {string} [iscsiServer.reverseChapId] The reverse chap id. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, iscsiServerName, iscsiServer, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(deviceName, iscsiServerName, iscsiServer, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {object} iscsiServer The iscsi server. - * - * @param {string} iscsiServer.storageDomainId The storage domain id. - * - * @param {string} iscsiServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [iscsiServer.description] The description. - * - * @param {string} [iscsiServer.chapId] The chap id. - * - * @param {string} [iscsiServer.reverseChapId] The reverse chap id. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIServer} - 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 ISCSIServer} 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(deviceName, iscsiServerName, iscsiServer, resourceGroupName, managerName, 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(deviceName, iscsiServerName, iscsiServer, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(deviceName, iscsiServerName, iscsiServer, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, iscsiServerName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(deviceName, iscsiServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, iscsiServerName, resourceGroupName, managerName, 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(deviceName, iscsiServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(deviceName, iscsiServerName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Backup the iscsi server now. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - backupNowWithHttpOperationResponse(deviceName, iscsiServerName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._backupNow(deviceName, iscsiServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Backup the iscsi server now. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - backupNow(deviceName, iscsiServerName, resourceGroupName, managerName, 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._backupNow(deviceName, iscsiServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._backupNow(deviceName, iscsiServerName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Gets the iscsi server metrics - * - * @param {string} deviceName The devie name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listMetricsWithHttpOperationResponse(deviceName, iscsiServerName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetrics(deviceName, iscsiServerName, resourceGroupName, managerName, 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 iscsi server metrics - * - * @param {string} deviceName The devie name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {MetricList} - 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 MetricList} 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. - */ - listMetrics(deviceName, iscsiServerName, resourceGroupName, managerName, 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._listMetrics(deviceName, iscsiServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetrics(deviceName, iscsiServerName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Retrieves metric definitions for all metrics aggregated at iscsi server. - * - * @param {string} deviceName The devie name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listMetricDefinitionWithHttpOperationResponse(deviceName, iscsiServerName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetricDefinition(deviceName, iscsiServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves metric definitions for all metrics aggregated at iscsi server. - * - * @param {string} deviceName The devie name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {MetricDefinitionList} - 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 MetricDefinitionList} 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. - */ - listMetricDefinition(deviceName, iscsiServerName, resourceGroupName, managerName, 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._listMetricDefinition(deviceName, iscsiServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetricDefinition(deviceName, iscsiServerName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Retrieves all the iscsi servers in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByManagerWithHttpOperationResponse(resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByManager(resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the iscsi servers in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIServerList} - 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 ISCSIServerList} 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. - */ - listByManager(resourceGroupName, managerName, 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._listByManager(resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByManager(resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {object} iscsiServer The iscsi server. - * - * @param {string} iscsiServer.storageDomainId The storage domain id. - * - * @param {string} iscsiServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [iscsiServer.description] The description. - * - * @param {string} [iscsiServer.chapId] The chap id. - * - * @param {string} [iscsiServer.reverseChapId] The reverse chap id. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(deviceName, iscsiServerName, iscsiServer, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(deviceName, iscsiServerName, iscsiServer, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {object} iscsiServer The iscsi server. - * - * @param {string} iscsiServer.storageDomainId The storage domain id. - * - * @param {string} iscsiServer.backupScheduleGroupId The backup policy id. - * - * @param {string} [iscsiServer.description] The description. - * - * @param {string} [iscsiServer.chapId] The chap id. - * - * @param {string} [iscsiServer.reverseChapId] The reverse chap id. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ISCSIServer} - 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 ISCSIServer} 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. - */ - beginCreateOrUpdate(deviceName, iscsiServerName, iscsiServer, resourceGroupName, managerName, 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._beginCreateOrUpdate(deviceName, iscsiServerName, iscsiServer, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(deviceName, iscsiServerName, iscsiServer, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(deviceName, iscsiServerName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(deviceName, iscsiServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the iscsi server. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(deviceName, iscsiServerName, resourceGroupName, managerName, 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._beginDeleteMethod(deviceName, iscsiServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(deviceName, iscsiServerName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Backup the iscsi server now. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginBackupNowWithHttpOperationResponse(deviceName, iscsiServerName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginBackupNow(deviceName, iscsiServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Backup the iscsi server now. - * - * @param {string} deviceName The device name. - * - * @param {string} iscsiServerName The iscsi server name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginBackupNow(deviceName, iscsiServerName, resourceGroupName, managerName, 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._beginBackupNow(deviceName, iscsiServerName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginBackupNow(deviceName, iscsiServerName, resourceGroupName, managerName, options, optionalCallback); - } - } - -} - -module.exports = IscsiServers; diff --git a/lib/services/storSimple1200Series/lib/operations/jobs.js b/lib/services/storSimple1200Series/lib/operations/jobs.js deleted file mode 100644 index 4c8bb0654d..0000000000 --- a/lib/services/storSimple1200Series/lib/operations/jobs.js +++ /dev/null @@ -1,1240 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * Retrieves all the jobs in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 JobList} 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 _listByDevice(deviceName, resourceGroupName, managerName, 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.'); - } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - // Validate - try { - if (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter 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.StorSimple/managers/{managerName}/devices/{deviceName}/jobs'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['JobList']().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); - }); -} - -/** - * Returns the properties of the specified job name. - * - * @param {string} deviceName The device name. - * - * @param {string} jobName The job name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 Job} 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(deviceName, jobName, resourceGroupName, managerName, 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 (deviceName === null || deviceName === undefined || typeof deviceName.valueOf() !== 'string') { - throw new Error('deviceName cannot be null or undefined and it must be of type string.'); - } - if (jobName === null || jobName === undefined || typeof jobName.valueOf() !== 'string') { - throw new Error('jobName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/devices/{deviceName}/jobs/{jobName}'; - requestUrl = requestUrl.replace('{deviceName}', encodeURIComponent(deviceName)); - requestUrl = requestUrl.replace('{jobName}', encodeURIComponent(jobName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['Job']().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); - }); -} - -/** - * Retrieves all the jobs in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 JobList} 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 _listByManager(resourceGroupName, managerName, 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.'); - } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - // Validate - try { - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter 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.StorSimple/managers/{managerName}/jobs'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['JobList']().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); - }); -} - -/** - * Retrieves all the jobs in a device. - * - * @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 JobList} 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 _listByDeviceNext(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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['JobList']().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); - }); -} - -/** - * Retrieves all the jobs in a manager. - * - * @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 JobList} 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 _listByManagerNext(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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['JobList']().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 Jobs. */ -class Jobs { - /** - * Create a Jobs. - * @param {StorSimpleManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listByDevice = _listByDevice; - this._get = _get; - this._listByManager = _listByManager; - this._listByDeviceNext = _listByDeviceNext; - this._listByManagerNext = _listByManagerNext; - } - - /** - * Retrieves all the jobs in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listByDeviceWithHttpOperationResponse(deviceName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByDevice(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the jobs in a device. - * - * @param {string} deviceName The device name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {JobList} - 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 JobList} 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. - */ - listByDevice(deviceName, resourceGroupName, managerName, 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._listByDevice(deviceName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByDevice(deviceName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Returns the properties of the specified job name. - * - * @param {string} deviceName The device name. - * - * @param {string} jobName The job name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(deviceName, jobName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(deviceName, jobName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the properties of the specified job name. - * - * @param {string} deviceName The device name. - * - * @param {string} jobName The job name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {Job} - 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 Job} 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(deviceName, jobName, resourceGroupName, managerName, 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(deviceName, jobName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(deviceName, jobName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Retrieves all the jobs in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listByManagerWithHttpOperationResponse(resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByManager(resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the jobs in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {JobList} - 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 JobList} 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. - */ - listByManager(resourceGroupName, managerName, 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._listByManager(resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByManager(resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Retrieves all the jobs in a device. - * - * @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. - */ - listByDeviceNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByDeviceNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the jobs in a device. - * - * @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 {JobList} - 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 JobList} 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. - */ - listByDeviceNext(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._listByDeviceNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByDeviceNext(nextPageLink, options, optionalCallback); - } - } - - /** - * Retrieves all the jobs in a manager. - * - * @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. - */ - listByManagerNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByManagerNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the jobs in a manager. - * - * @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 {JobList} - 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 JobList} 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. - */ - listByManagerNext(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._listByManagerNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByManagerNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = Jobs; diff --git a/lib/services/storSimple1200Series/lib/operations/managers.js b/lib/services/storSimple1200Series/lib/operations/managers.js deleted file mode 100644 index 629cd6e749..0000000000 --- a/lib/services/storSimple1200Series/lib/operations/managers.js +++ /dev/null @@ -1,3965 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * Retrieves all the managers in a subscription. - * - * @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 ManagerList} 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.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.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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.StorSimple/managers'; - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ManagerList']().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); - }); -} - -/** - * Retrieves all the managers in a resource group. - * - * @param {string} resourceGroupName The resource group name - * - * @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 ManagerList} 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 _listByResourceGroup(resourceGroupName, 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.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 (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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ManagerList']().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); - }); -} - -/** - * Returns the properties of the specified manager name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 Manager} 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, managerName, 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.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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['Manager']().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); - }); -} - -/** - * Creates or updates the manager. - * - * @param {object} manager The manager. - * - * @param {object} [manager.cisIntrinsicSettings] Specifies if the Manager is - * Garda or Helsinki - * - * @param {string} manager.cisIntrinsicSettings.type Refers to the type of the - * StorSimple Manager. Possible values include: 'GardaV1', 'HelsinkiV1' - * - * @param {string} [manager.etag] ETag of the Manager - * - * @param {string} manager.location The Geo location of the Manager - * - * @param {object} [manager.tags] Tags attached to the Manager - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 Manager} 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(manager, resourceGroupName, managerName, 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.'); - } - if (manager === null || manager === undefined) - { - manager = {}; - } - // Validate - try { - if (manager === null || manager === undefined) { - throw new Error('manager cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 (manager !== null && manager !== undefined) { - let requestModelMapper = new client.models['Manager']().mapper(); - requestModel = client.serialize(requestModelMapper, manager, 'manager'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(manager, 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['Manager']().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['Manager']().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); - }); -} - -/** - * Deletes the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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, managerName, 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.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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** - * Updates the StorSimple Manager. - * - * @param {object} parameters The manager update parameters. - * - * @param {object} [parameters.tags] The tags attached to the StorSimple - * Manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 Manager} 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 _update(parameters, resourceGroupName, managerName, 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.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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 = 'PATCH'; - 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['ManagerPatch']().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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['Manager']().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); - }); -} - -/** - * Upload Vault Cred Certificate. - * Returns UploadCertificateResponse - * - * @param {string} certificateName Certificate Name - * - * @param {object} uploadCertificateRequestrequest UploadCertificateRequest - * Request - * - * @param {string} [uploadCertificateRequestrequest.authType] Specify the - * Authentication type. Possible values include: 'Invalid', - * 'AccessControlService', 'AzureActiveDirectory' - * - * @param {string} uploadCertificateRequestrequest.certificate Gets or sets the - * base64 encoded certificate raw data string - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 UploadCertificateResponse} 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 _uploadRegistrationCertificate(certificateName, uploadCertificateRequestrequest, resourceGroupName, managerName, 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 (certificateName === null || certificateName === undefined || typeof certificateName.valueOf() !== 'string') { - throw new Error('certificateName cannot be null or undefined and it must be of type string.'); - } - if (uploadCertificateRequestrequest === null || uploadCertificateRequestrequest === undefined) { - throw new Error('uploadCertificateRequestrequest cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/certificates/{certificateName}'; - requestUrl = requestUrl.replace('{certificateName}', encodeURIComponent(certificateName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 (uploadCertificateRequestrequest !== null && uploadCertificateRequestrequest !== undefined) { - let requestModelMapper = new client.models['UploadCertificateRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, uploadCertificateRequestrequest, 'uploadCertificateRequestrequest'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(uploadCertificateRequestrequest, 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['UploadCertificateResponse']().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); - }); -} - -/** - * Returns the encryption settings of the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 EncryptionSettings} 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 _getEncryptionSettings(resourceGroupName, managerName, 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.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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/encryptionSettings/default'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['EncryptionSettings']().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); - }); -} - -/** - * Returns the extended information of the specified manager name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 ManagerExtendedInfo} 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 _getExtendedInfo(resourceGroupName, managerName, 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.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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ManagerExtendedInfo']().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); - }); -} - -/** - * Creates the extended info of the manager. - * - * @param {object} managerExtendedInfo The manager extended information. - * - * @param {string} [managerExtendedInfo.version] Represents the version of the - * ExtendedInfo object being persisted - * - * @param {string} managerExtendedInfo.integrityKey Represents the CIK of the - * resource - * - * @param {string} [managerExtendedInfo.encryptionKey] Represents the CEK of - * the resource - * - * @param {string} [managerExtendedInfo.encryptionKeyThumbprint] Represents the - * Cert thumbprint that was used to encrypt the CEK - * - * @param {string} [managerExtendedInfo.portalCertificateThumbprint] Represents - * the portal thumbprint which can be used optionally to encrypt the entire - * data before storing it. - * - * @param {string} managerExtendedInfo.algorithm Represents the encryption - * algorithm used to encrypt the other keys. None - if EncryptionKey is saved - * in plain text format. AlgorithmName - if encryption is used - * - * @param {string} [managerExtendedInfo.etag] ETag of the Resource - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 ManagerExtendedInfo} 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 _createExtendedInfo(managerExtendedInfo, resourceGroupName, managerName, 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 (managerExtendedInfo === null || managerExtendedInfo === undefined) { - throw new Error('managerExtendedInfo cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 (managerExtendedInfo !== null && managerExtendedInfo !== undefined) { - let requestModelMapper = new client.models['ManagerExtendedInfo']().mapper(); - requestModel = client.serialize(requestModelMapper, managerExtendedInfo, 'managerExtendedInfo'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(managerExtendedInfo, 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ManagerExtendedInfo']().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 the extended info of the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _deleteExtendedInfo(resourceGroupName, managerName, 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.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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 !== 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** - * Updates the extended info of the manager. - * - * @param {object} managerExtendedInfo The manager extended information. - * - * @param {string} [managerExtendedInfo.version] Represents the version of the - * ExtendedInfo object being persisted - * - * @param {string} managerExtendedInfo.integrityKey Represents the CIK of the - * resource - * - * @param {string} [managerExtendedInfo.encryptionKey] Represents the CEK of - * the resource - * - * @param {string} [managerExtendedInfo.encryptionKeyThumbprint] Represents the - * Cert thumbprint that was used to encrypt the CEK - * - * @param {string} [managerExtendedInfo.portalCertificateThumbprint] Represents - * the portal thumbprint which can be used optionally to encrypt the entire - * data before storing it. - * - * @param {string} managerExtendedInfo.algorithm Represents the encryption - * algorithm used to encrypt the other keys. None - if EncryptionKey is saved - * in plain text format. AlgorithmName - if encryption is used - * - * @param {string} [managerExtendedInfo.etag] ETag of the Resource - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {string} ifMatch Pass the ETag of ExtendedInfo fetched from GET call - * - * @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 ManagerExtendedInfo} 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 _updateExtendedInfo(managerExtendedInfo, resourceGroupName, managerName, ifMatch, 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 (managerExtendedInfo === null || managerExtendedInfo === undefined) { - throw new Error('managerExtendedInfo cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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 (ifMatch === null || ifMatch === undefined || typeof ifMatch.valueOf() !== 'string') { - throw new Error('ifMatch 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.StorSimple/managers/{managerName}/extendedInformation/vaultExtendedInfo'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 = 'PATCH'; - 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 (ifMatch !== undefined && ifMatch !== null) { - httpRequest.headers['If-Match'] = ifMatch; - } - 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 (managerExtendedInfo !== null && managerExtendedInfo !== undefined) { - let requestModelMapper = new client.models['ManagerExtendedInfo']().mapper(); - requestModel = client.serialize(requestModelMapper, managerExtendedInfo, 'managerExtendedInfo'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(managerExtendedInfo, 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['ManagerExtendedInfo']().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); - }); -} - -/** - * Returns the symmetric encryption key of the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 SymmetricEncryptedSecret} 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 _getEncryptionKey(resourceGroupName, managerName, 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.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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/getEncryptionKey'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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]; - } - } - } - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['SymmetricEncryptedSecret']().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); - }); -} - -/** - * Gets the manager metrics - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 MetricList} 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 _listMetrics(resourceGroupName, managerName, 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.'); - } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - // Validate - try { - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter 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.StorSimple/managers/{managerName}/metrics'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); - if (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + encodeURIComponent(filter)); - } - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['MetricList']().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); - }); -} - -/** - * Retrieves metric definition of all metrics aggregated at manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 MetricDefinitionList} 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 _listMetricDefinition(resourceGroupName, managerName, 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.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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/metricsDefinitions'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['MetricDefinitionList']().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 Managers. */ -class Managers { - /** - * Create a Managers. - * @param {StorSimpleManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._listByResourceGroup = _listByResourceGroup; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._deleteMethod = _deleteMethod; - this._update = _update; - this._uploadRegistrationCertificate = _uploadRegistrationCertificate; - this._getEncryptionSettings = _getEncryptionSettings; - this._getExtendedInfo = _getExtendedInfo; - this._createExtendedInfo = _createExtendedInfo; - this._deleteExtendedInfo = _deleteExtendedInfo; - this._updateExtendedInfo = _updateExtendedInfo; - this._getEncryptionKey = _getEncryptionKey; - this._listMetrics = _listMetrics; - this._listMetricDefinition = _listMetricDefinition; - } - - /** - * Retrieves all the managers in a subscription. - * - * @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; - }); - }); - } - - /** - * Retrieves all the managers in a subscription. - * - * @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 {ManagerList} - 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 ManagerList} 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); - } - } - - /** - * Retrieves all the managers in a resource group. - * - * @param {string} resourceGroupName The resource group name - * - * @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. - */ - listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the managers in a resource group. - * - * @param {string} resourceGroupName The resource group name - * - * @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 {ManagerList} - 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 ManagerList} 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. - */ - listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByResourceGroup(resourceGroupName, options, optionalCallback); - } - } - - /** - * Returns the properties of the specified manager name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the properties of the specified manager name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {Manager} - 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 Manager} 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, managerName, 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, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the manager. - * - * @param {object} manager The manager. - * - * @param {object} [manager.cisIntrinsicSettings] Specifies if the Manager is - * Garda or Helsinki - * - * @param {string} manager.cisIntrinsicSettings.type Refers to the type of the - * StorSimple Manager. Possible values include: 'GardaV1', 'HelsinkiV1' - * - * @param {string} [manager.etag] ETag of the Manager - * - * @param {string} manager.location The Geo location of the Manager - * - * @param {object} [manager.tags] Tags attached to the Manager - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(manager, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(manager, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the manager. - * - * @param {object} manager The manager. - * - * @param {object} [manager.cisIntrinsicSettings] Specifies if the Manager is - * Garda or Helsinki - * - * @param {string} manager.cisIntrinsicSettings.type Refers to the type of the - * StorSimple Manager. Possible values include: 'GardaV1', 'HelsinkiV1' - * - * @param {string} [manager.etag] ETag of the Manager - * - * @param {string} manager.location The Geo location of the Manager - * - * @param {object} [manager.tags] Tags attached to the Manager - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {Manager} - 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 Manager} 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(manager, resourceGroupName, managerName, 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(manager, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(manager, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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, managerName, 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, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Updates the StorSimple Manager. - * - * @param {object} parameters The manager update parameters. - * - * @param {object} [parameters.tags] The tags attached to the StorSimple - * Manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - updateWithHttpOperationResponse(parameters, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._update(parameters, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates the StorSimple Manager. - * - * @param {object} parameters The manager update parameters. - * - * @param {object} [parameters.tags] The tags attached to the StorSimple - * Manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {Manager} - 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 Manager} 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. - */ - update(parameters, resourceGroupName, managerName, 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._update(parameters, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._update(parameters, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Upload Vault Cred Certificate. - * Returns UploadCertificateResponse - * - * @param {string} certificateName Certificate Name - * - * @param {object} uploadCertificateRequestrequest UploadCertificateRequest - * Request - * - * @param {string} [uploadCertificateRequestrequest.authType] Specify the - * Authentication type. Possible values include: 'Invalid', - * 'AccessControlService', 'AzureActiveDirectory' - * - * @param {string} uploadCertificateRequestrequest.certificate Gets or sets the - * base64 encoded certificate raw data string - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - uploadRegistrationCertificateWithHttpOperationResponse(certificateName, uploadCertificateRequestrequest, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._uploadRegistrationCertificate(certificateName, uploadCertificateRequestrequest, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Upload Vault Cred Certificate. - * Returns UploadCertificateResponse - * - * @param {string} certificateName Certificate Name - * - * @param {object} uploadCertificateRequestrequest UploadCertificateRequest - * Request - * - * @param {string} [uploadCertificateRequestrequest.authType] Specify the - * Authentication type. Possible values include: 'Invalid', - * 'AccessControlService', 'AzureActiveDirectory' - * - * @param {string} uploadCertificateRequestrequest.certificate Gets or sets the - * base64 encoded certificate raw data string - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {UploadCertificateResponse} - 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 UploadCertificateResponse} 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. - */ - uploadRegistrationCertificate(certificateName, uploadCertificateRequestrequest, resourceGroupName, managerName, 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._uploadRegistrationCertificate(certificateName, uploadCertificateRequestrequest, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._uploadRegistrationCertificate(certificateName, uploadCertificateRequestrequest, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Returns the encryption settings of the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - getEncryptionSettingsWithHttpOperationResponse(resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getEncryptionSettings(resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the encryption settings of the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {EncryptionSettings} - 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 EncryptionSettings} 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. - */ - getEncryptionSettings(resourceGroupName, managerName, 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._getEncryptionSettings(resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getEncryptionSettings(resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Returns the extended information of the specified manager name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - getExtendedInfoWithHttpOperationResponse(resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getExtendedInfo(resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the extended information of the specified manager name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ManagerExtendedInfo} - 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 ManagerExtendedInfo} 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. - */ - getExtendedInfo(resourceGroupName, managerName, 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._getExtendedInfo(resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getExtendedInfo(resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates the extended info of the manager. - * - * @param {object} managerExtendedInfo The manager extended information. - * - * @param {string} [managerExtendedInfo.version] Represents the version of the - * ExtendedInfo object being persisted - * - * @param {string} managerExtendedInfo.integrityKey Represents the CIK of the - * resource - * - * @param {string} [managerExtendedInfo.encryptionKey] Represents the CEK of - * the resource - * - * @param {string} [managerExtendedInfo.encryptionKeyThumbprint] Represents the - * Cert thumbprint that was used to encrypt the CEK - * - * @param {string} [managerExtendedInfo.portalCertificateThumbprint] Represents - * the portal thumbprint which can be used optionally to encrypt the entire - * data before storing it. - * - * @param {string} managerExtendedInfo.algorithm Represents the encryption - * algorithm used to encrypt the other keys. None - if EncryptionKey is saved - * in plain text format. AlgorithmName - if encryption is used - * - * @param {string} [managerExtendedInfo.etag] ETag of the Resource - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - createExtendedInfoWithHttpOperationResponse(managerExtendedInfo, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createExtendedInfo(managerExtendedInfo, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates the extended info of the manager. - * - * @param {object} managerExtendedInfo The manager extended information. - * - * @param {string} [managerExtendedInfo.version] Represents the version of the - * ExtendedInfo object being persisted - * - * @param {string} managerExtendedInfo.integrityKey Represents the CIK of the - * resource - * - * @param {string} [managerExtendedInfo.encryptionKey] Represents the CEK of - * the resource - * - * @param {string} [managerExtendedInfo.encryptionKeyThumbprint] Represents the - * Cert thumbprint that was used to encrypt the CEK - * - * @param {string} [managerExtendedInfo.portalCertificateThumbprint] Represents - * the portal thumbprint which can be used optionally to encrypt the entire - * data before storing it. - * - * @param {string} managerExtendedInfo.algorithm Represents the encryption - * algorithm used to encrypt the other keys. None - if EncryptionKey is saved - * in plain text format. AlgorithmName - if encryption is used - * - * @param {string} [managerExtendedInfo.etag] ETag of the Resource - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {ManagerExtendedInfo} - 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 ManagerExtendedInfo} 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. - */ - createExtendedInfo(managerExtendedInfo, resourceGroupName, managerName, 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._createExtendedInfo(managerExtendedInfo, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createExtendedInfo(managerExtendedInfo, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the extended info of the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - deleteExtendedInfoWithHttpOperationResponse(resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteExtendedInfo(resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the extended info of the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - deleteExtendedInfo(resourceGroupName, managerName, 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._deleteExtendedInfo(resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteExtendedInfo(resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Updates the extended info of the manager. - * - * @param {object} managerExtendedInfo The manager extended information. - * - * @param {string} [managerExtendedInfo.version] Represents the version of the - * ExtendedInfo object being persisted - * - * @param {string} managerExtendedInfo.integrityKey Represents the CIK of the - * resource - * - * @param {string} [managerExtendedInfo.encryptionKey] Represents the CEK of - * the resource - * - * @param {string} [managerExtendedInfo.encryptionKeyThumbprint] Represents the - * Cert thumbprint that was used to encrypt the CEK - * - * @param {string} [managerExtendedInfo.portalCertificateThumbprint] Represents - * the portal thumbprint which can be used optionally to encrypt the entire - * data before storing it. - * - * @param {string} managerExtendedInfo.algorithm Represents the encryption - * algorithm used to encrypt the other keys. None - if EncryptionKey is saved - * in plain text format. AlgorithmName - if encryption is used - * - * @param {string} [managerExtendedInfo.etag] ETag of the Resource - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {string} ifMatch Pass the ETag of ExtendedInfo fetched from GET call - * - * @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. - */ - updateExtendedInfoWithHttpOperationResponse(managerExtendedInfo, resourceGroupName, managerName, ifMatch, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateExtendedInfo(managerExtendedInfo, resourceGroupName, managerName, ifMatch, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Updates the extended info of the manager. - * - * @param {object} managerExtendedInfo The manager extended information. - * - * @param {string} [managerExtendedInfo.version] Represents the version of the - * ExtendedInfo object being persisted - * - * @param {string} managerExtendedInfo.integrityKey Represents the CIK of the - * resource - * - * @param {string} [managerExtendedInfo.encryptionKey] Represents the CEK of - * the resource - * - * @param {string} [managerExtendedInfo.encryptionKeyThumbprint] Represents the - * Cert thumbprint that was used to encrypt the CEK - * - * @param {string} [managerExtendedInfo.portalCertificateThumbprint] Represents - * the portal thumbprint which can be used optionally to encrypt the entire - * data before storing it. - * - * @param {string} managerExtendedInfo.algorithm Represents the encryption - * algorithm used to encrypt the other keys. None - if EncryptionKey is saved - * in plain text format. AlgorithmName - if encryption is used - * - * @param {string} [managerExtendedInfo.etag] ETag of the Resource - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {string} ifMatch Pass the ETag of ExtendedInfo fetched from GET call - * - * @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 {ManagerExtendedInfo} - 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 ManagerExtendedInfo} 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. - */ - updateExtendedInfo(managerExtendedInfo, resourceGroupName, managerName, ifMatch, 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._updateExtendedInfo(managerExtendedInfo, resourceGroupName, managerName, ifMatch, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateExtendedInfo(managerExtendedInfo, resourceGroupName, managerName, ifMatch, options, optionalCallback); - } - } - - /** - * Returns the symmetric encryption key of the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - getEncryptionKeyWithHttpOperationResponse(resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getEncryptionKey(resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the symmetric encryption key of the manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {SymmetricEncryptedSecret} - 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 SymmetricEncryptedSecret} 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. - */ - getEncryptionKey(resourceGroupName, managerName, 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._getEncryptionKey(resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getEncryptionKey(resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Gets the manager metrics - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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. - */ - listMetricsWithHttpOperationResponse(resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetrics(resourceGroupName, managerName, 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 manager metrics - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] OData Filter options - * - * @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 {MetricList} - 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 MetricList} 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. - */ - listMetrics(resourceGroupName, managerName, 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._listMetrics(resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetrics(resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Retrieves metric definition of all metrics aggregated at manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listMetricDefinitionWithHttpOperationResponse(resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetricDefinition(resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves metric definition of all metrics aggregated at manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {MetricDefinitionList} - 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 MetricDefinitionList} 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. - */ - listMetricDefinition(resourceGroupName, managerName, 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._listMetricDefinition(resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetricDefinition(resourceGroupName, managerName, options, optionalCallback); - } - } - -} - -module.exports = Managers; diff --git a/lib/services/storSimple1200Series/lib/operations/storageAccountCredentials.js b/lib/services/storSimple1200Series/lib/operations/storageAccountCredentials.js deleted file mode 100644 index ceef8a59ac..0000000000 --- a/lib/services/storSimple1200Series/lib/operations/storageAccountCredentials.js +++ /dev/null @@ -1,1540 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * Retrieves all the storage account credentials in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 StorageAccountCredentialList} 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 _listByManager(resourceGroupName, managerName, 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.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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['StorageAccountCredentialList']().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); - }); -} - -/** - * Returns the properties of the specified storage account credential name. - * - * @param {string} credentialName The name of storage account credential to be - * fetched. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 StorageAccountCredential} 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(credentialName, resourceGroupName, managerName, 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 (credentialName === null || credentialName === undefined || typeof credentialName.valueOf() !== 'string') { - throw new Error('credentialName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{credentialName}'; - requestUrl = requestUrl.replace('{credentialName}', encodeURIComponent(credentialName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['StorageAccountCredential']().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); - }); -} - - -/** - * Creates or updates the storage account credential - * - * @param {string} credentialName The credential name. - * - * @param {object} storageAccount The storage account credential to be added or - * updated. - * - * @param {string} storageAccount.cloudType The cloud service provider. - * Possible values include: 'Azure', 'S3', 'S3_RRS', 'OpenStack', 'HP' - * - * @param {string} storageAccount.endPoint The storage endpoint - * - * @param {string} storageAccount.login The storage account login - * - * @param {string} [storageAccount.location] The storage account's geo location - * - * @param {string} storageAccount.enableSSL SSL needs to be enabled or not. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [storageAccount.accessKey] The details of the storage - * account password - * - * @param {string} storageAccount.accessKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} [storageAccount.accessKey.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} storageAccount.accessKey.encryptionAlgorithm Algorithm used - * to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 StorageAccountCredential} 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(credentialName, storageAccount, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginCreateOrUpdate(credentialName, storageAccount, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StorageAccountCredential']().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 the storage account credential - * - * @param {string} credentialName The name of the storage account credential. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(credentialName, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginDeleteMethod(credentialName, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Creates or updates the storage account credential - * - * @param {string} credentialName The credential name. - * - * @param {object} storageAccount The storage account credential to be added or - * updated. - * - * @param {string} storageAccount.cloudType The cloud service provider. - * Possible values include: 'Azure', 'S3', 'S3_RRS', 'OpenStack', 'HP' - * - * @param {string} storageAccount.endPoint The storage endpoint - * - * @param {string} storageAccount.login The storage account login - * - * @param {string} [storageAccount.location] The storage account's geo location - * - * @param {string} storageAccount.enableSSL SSL needs to be enabled or not. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [storageAccount.accessKey] The details of the storage - * account password - * - * @param {string} storageAccount.accessKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} [storageAccount.accessKey.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} storageAccount.accessKey.encryptionAlgorithm Algorithm used - * to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 StorageAccountCredential} 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 _beginCreateOrUpdate(credentialName, storageAccount, resourceGroupName, managerName, 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 (credentialName === null || credentialName === undefined || typeof credentialName.valueOf() !== 'string') { - throw new Error('credentialName cannot be null or undefined and it must be of type string.'); - } - if (storageAccount === null || storageAccount === undefined) { - throw new Error('storageAccount cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{credentialName}'; - requestUrl = requestUrl.replace('{credentialName}', encodeURIComponent(credentialName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 (storageAccount !== null && storageAccount !== undefined) { - let requestModelMapper = new client.models['StorageAccountCredential']().mapper(); - requestModel = client.serialize(requestModelMapper, storageAccount, 'storageAccount'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(storageAccount, 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 !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['StorageAccountCredential']().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 the storage account credential - * - * @param {string} credentialName The name of the storage account credential. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginDeleteMethod(credentialName, resourceGroupName, managerName, 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 (credentialName === null || credentialName === undefined || typeof credentialName.valueOf() !== 'string') { - throw new Error('credentialName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageAccountCredentials/{credentialName}'; - requestUrl = requestUrl.replace('{credentialName}', encodeURIComponent(credentialName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** Class representing a StorageAccountCredentials. */ -class StorageAccountCredentials { - /** - * Create a StorageAccountCredentials. - * @param {StorSimpleManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listByManager = _listByManager; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._deleteMethod = _deleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - } - - /** - * Retrieves all the storage account credentials in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByManagerWithHttpOperationResponse(resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByManager(resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the storage account credentials in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {StorageAccountCredentialList} - 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 StorageAccountCredentialList} 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. - */ - listByManager(resourceGroupName, managerName, 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._listByManager(resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByManager(resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Returns the properties of the specified storage account credential name. - * - * @param {string} credentialName The name of storage account credential to be - * fetched. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(credentialName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(credentialName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the properties of the specified storage account credential name. - * - * @param {string} credentialName The name of storage account credential to be - * fetched. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {StorageAccountCredential} - 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 StorageAccountCredential} 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(credentialName, resourceGroupName, managerName, 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(credentialName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(credentialName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the storage account credential - * - * @param {string} credentialName The credential name. - * - * @param {object} storageAccount The storage account credential to be added or - * updated. - * - * @param {string} storageAccount.cloudType The cloud service provider. - * Possible values include: 'Azure', 'S3', 'S3_RRS', 'OpenStack', 'HP' - * - * @param {string} storageAccount.endPoint The storage endpoint - * - * @param {string} storageAccount.login The storage account login - * - * @param {string} [storageAccount.location] The storage account's geo location - * - * @param {string} storageAccount.enableSSL SSL needs to be enabled or not. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [storageAccount.accessKey] The details of the storage - * account password - * - * @param {string} storageAccount.accessKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} [storageAccount.accessKey.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} storageAccount.accessKey.encryptionAlgorithm Algorithm used - * to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(credentialName, storageAccount, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(credentialName, storageAccount, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the storage account credential - * - * @param {string} credentialName The credential name. - * - * @param {object} storageAccount The storage account credential to be added or - * updated. - * - * @param {string} storageAccount.cloudType The cloud service provider. - * Possible values include: 'Azure', 'S3', 'S3_RRS', 'OpenStack', 'HP' - * - * @param {string} storageAccount.endPoint The storage endpoint - * - * @param {string} storageAccount.login The storage account login - * - * @param {string} [storageAccount.location] The storage account's geo location - * - * @param {string} storageAccount.enableSSL SSL needs to be enabled or not. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [storageAccount.accessKey] The details of the storage - * account password - * - * @param {string} storageAccount.accessKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} [storageAccount.accessKey.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} storageAccount.accessKey.encryptionAlgorithm Algorithm used - * to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {StorageAccountCredential} - 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 StorageAccountCredential} 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(credentialName, storageAccount, resourceGroupName, managerName, 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(credentialName, storageAccount, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(credentialName, storageAccount, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the storage account credential - * - * @param {string} credentialName The name of the storage account credential. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(credentialName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(credentialName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the storage account credential - * - * @param {string} credentialName The name of the storage account credential. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(credentialName, resourceGroupName, managerName, 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(credentialName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(credentialName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the storage account credential - * - * @param {string} credentialName The credential name. - * - * @param {object} storageAccount The storage account credential to be added or - * updated. - * - * @param {string} storageAccount.cloudType The cloud service provider. - * Possible values include: 'Azure', 'S3', 'S3_RRS', 'OpenStack', 'HP' - * - * @param {string} storageAccount.endPoint The storage endpoint - * - * @param {string} storageAccount.login The storage account login - * - * @param {string} [storageAccount.location] The storage account's geo location - * - * @param {string} storageAccount.enableSSL SSL needs to be enabled or not. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [storageAccount.accessKey] The details of the storage - * account password - * - * @param {string} storageAccount.accessKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} [storageAccount.accessKey.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} storageAccount.accessKey.encryptionAlgorithm Algorithm used - * to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(credentialName, storageAccount, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(credentialName, storageAccount, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the storage account credential - * - * @param {string} credentialName The credential name. - * - * @param {object} storageAccount The storage account credential to be added or - * updated. - * - * @param {string} storageAccount.cloudType The cloud service provider. - * Possible values include: 'Azure', 'S3', 'S3_RRS', 'OpenStack', 'HP' - * - * @param {string} storageAccount.endPoint The storage endpoint - * - * @param {string} storageAccount.login The storage account login - * - * @param {string} [storageAccount.location] The storage account's geo location - * - * @param {string} storageAccount.enableSSL SSL needs to be enabled or not. - * Possible values include: 'Enabled', 'Disabled' - * - * @param {object} [storageAccount.accessKey] The details of the storage - * account password - * - * @param {string} storageAccount.accessKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} [storageAccount.accessKey.encryptionCertificateThumbprint] - * Thumbprint certificate that was used to encrypt "Value" - * - * @param {string} storageAccount.accessKey.encryptionAlgorithm Algorithm used - * to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {StorageAccountCredential} - 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 StorageAccountCredential} 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. - */ - beginCreateOrUpdate(credentialName, storageAccount, resourceGroupName, managerName, 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._beginCreateOrUpdate(credentialName, storageAccount, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(credentialName, storageAccount, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the storage account credential - * - * @param {string} credentialName The name of the storage account credential. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(credentialName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(credentialName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the storage account credential - * - * @param {string} credentialName The name of the storage account credential. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(credentialName, resourceGroupName, managerName, 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._beginDeleteMethod(credentialName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(credentialName, resourceGroupName, managerName, options, optionalCallback); - } - } - -} - -module.exports = StorageAccountCredentials; diff --git a/lib/services/storSimple1200Series/lib/operations/storageDomains.js b/lib/services/storSimple1200Series/lib/operations/storageDomains.js deleted file mode 100644 index 94a9d52b44..0000000000 --- a/lib/services/storSimple1200Series/lib/operations/storageDomains.js +++ /dev/null @@ -1,1493 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * Retrieves all the storage domains in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 StorageDomainList} 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 _listByManager(resourceGroupName, managerName, 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.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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['StorageDomainList']().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); - }); -} - -/** - * Returns the properties of the specified storage domain name. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 StorageDomain} 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(storageDomainName, resourceGroupName, managerName, 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 (storageDomainName === null || storageDomainName === undefined || typeof storageDomainName.valueOf() !== 'string') { - throw new Error('storageDomainName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains/{storageDomainName}'; - requestUrl = requestUrl.replace('{storageDomainName}', encodeURIComponent(storageDomainName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['StorageDomain']().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); - }); -} - - -/** - * Creates or updates the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {object} storageDomain The storageDomain. - * - * @param {array} storageDomain.storageAccountCredentialIds The storage account - * credentials. - * - * @param {object} [storageDomain.encryptionKey] The encryption key used to - * encrypt the data. This is a user secret. - * - * @param {string} storageDomain.encryptionKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} - * [storageDomain.encryptionKey.encryptionCertificateThumbprint] Thumbprint - * certificate that was used to encrypt "Value" - * - * @param {string} storageDomain.encryptionKey.encryptionAlgorithm Algorithm - * used to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} storageDomain.encryptionStatus The encryption status - * "Enabled | Disabled". Possible values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 StorageDomain} 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(storageDomainName, storageDomain, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginCreateOrUpdate(storageDomainName, storageDomain, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StorageDomain']().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 the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(storageDomainName, resourceGroupName, managerName, 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.'); - } - - // Send request - this.beginDeleteMethod(storageDomainName, resourceGroupName, managerName, options, (err, parsedResult, httpRequest, response) => { - if (err) return callback(err); - - let initialResult = new msRest.HttpOperationResponse(); - initialResult.request = httpRequest; - initialResult.response = response; - initialResult.body = response.body; - client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { - if (err) return callback(err); - - // Create Result - let result = null; - - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; - if (responseBody === '') responseBody = null; - - // Deserialize Response - - return callback(null, result, httpRequest, response); - }); - }); -} - -/** - * Creates or updates the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {object} storageDomain The storageDomain. - * - * @param {array} storageDomain.storageAccountCredentialIds The storage account - * credentials. - * - * @param {object} [storageDomain.encryptionKey] The encryption key used to - * encrypt the data. This is a user secret. - * - * @param {string} storageDomain.encryptionKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} - * [storageDomain.encryptionKey.encryptionCertificateThumbprint] Thumbprint - * certificate that was used to encrypt "Value" - * - * @param {string} storageDomain.encryptionKey.encryptionAlgorithm Algorithm - * used to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} storageDomain.encryptionStatus The encryption status - * "Enabled | Disabled". Possible values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 StorageDomain} 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 _beginCreateOrUpdate(storageDomainName, storageDomain, resourceGroupName, managerName, 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 (storageDomainName === null || storageDomainName === undefined || typeof storageDomainName.valueOf() !== 'string') { - throw new Error('storageDomainName cannot be null or undefined and it must be of type string.'); - } - if (storageDomain === null || storageDomain === undefined) { - throw new Error('storageDomain cannot be null or undefined.'); - } - 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains/{storageDomainName}'; - requestUrl = requestUrl.replace('{storageDomainName}', encodeURIComponent(storageDomainName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 (storageDomain !== null && storageDomain !== undefined) { - let requestModelMapper = new client.models['StorageDomain']().mapper(); - requestModel = client.serialize(requestModelMapper, storageDomain, 'storageDomain'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(storageDomain, 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 !== 202) { - 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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['StorageDomain']().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 the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 _beginDeleteMethod(storageDomainName, resourceGroupName, managerName, 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 (storageDomainName === null || storageDomainName === undefined || typeof storageDomainName.valueOf() !== 'string') { - throw new Error('storageDomainName 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 (managerName === null || managerName === undefined || typeof managerName.valueOf() !== 'string') { - throw new Error('managerName cannot be null or undefined and it must be of type string.'); - } - if (managerName !== null && managerName !== undefined) { - if (managerName.length > 50) - { - throw new Error('"managerName" should satisfy the constraint - "MaxLength": 50'); - } - if (managerName.length < 2) - { - throw new Error('"managerName" should satisfy the constraint - "MinLength": 2'); - } - } - 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('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorSimple/managers/{managerName}/storageDomains/{storageDomainName}'; - requestUrl = requestUrl.replace('{storageDomainName}', encodeURIComponent(storageDomainName)); - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{managerName}', encodeURIComponent(managerName)); - 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 !== 202 && 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) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorModel']().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); - }); -} - -/** Class representing a StorageDomains. */ -class StorageDomains { - /** - * Create a StorageDomains. - * @param {StorSimpleManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._listByManager = _listByManager; - this._get = _get; - this._createOrUpdate = _createOrUpdate; - this._deleteMethod = _deleteMethod; - this._beginCreateOrUpdate = _beginCreateOrUpdate; - this._beginDeleteMethod = _beginDeleteMethod; - } - - /** - * Retrieves all the storage domains in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - listByManagerWithHttpOperationResponse(resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listByManager(resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Retrieves all the storage domains in a manager. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {StorageDomainList} - 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 StorageDomainList} 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. - */ - listByManager(resourceGroupName, managerName, 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._listByManager(resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listByManager(resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Returns the properties of the specified storage domain name. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(storageDomainName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(storageDomainName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Returns the properties of the specified storage domain name. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {StorageDomain} - 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 StorageDomain} 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(storageDomainName, resourceGroupName, managerName, 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(storageDomainName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._get(storageDomainName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {object} storageDomain The storageDomain. - * - * @param {array} storageDomain.storageAccountCredentialIds The storage account - * credentials. - * - * @param {object} [storageDomain.encryptionKey] The encryption key used to - * encrypt the data. This is a user secret. - * - * @param {string} storageDomain.encryptionKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} - * [storageDomain.encryptionKey.encryptionCertificateThumbprint] Thumbprint - * certificate that was used to encrypt "Value" - * - * @param {string} storageDomain.encryptionKey.encryptionAlgorithm Algorithm - * used to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} storageDomain.encryptionStatus The encryption status - * "Enabled | Disabled". Possible values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(storageDomainName, storageDomain, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdate(storageDomainName, storageDomain, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {object} storageDomain The storageDomain. - * - * @param {array} storageDomain.storageAccountCredentialIds The storage account - * credentials. - * - * @param {object} [storageDomain.encryptionKey] The encryption key used to - * encrypt the data. This is a user secret. - * - * @param {string} storageDomain.encryptionKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} - * [storageDomain.encryptionKey.encryptionCertificateThumbprint] Thumbprint - * certificate that was used to encrypt "Value" - * - * @param {string} storageDomain.encryptionKey.encryptionAlgorithm Algorithm - * used to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} storageDomain.encryptionStatus The encryption status - * "Enabled | Disabled". Possible values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {StorageDomain} - 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 StorageDomain} 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(storageDomainName, storageDomain, resourceGroupName, managerName, 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(storageDomainName, storageDomain, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdate(storageDomainName, storageDomain, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(storageDomainName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(storageDomainName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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(storageDomainName, resourceGroupName, managerName, 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(storageDomainName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(storageDomainName, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Creates or updates the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {object} storageDomain The storageDomain. - * - * @param {array} storageDomain.storageAccountCredentialIds The storage account - * credentials. - * - * @param {object} [storageDomain.encryptionKey] The encryption key used to - * encrypt the data. This is a user secret. - * - * @param {string} storageDomain.encryptionKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} - * [storageDomain.encryptionKey.encryptionCertificateThumbprint] Thumbprint - * certificate that was used to encrypt "Value" - * - * @param {string} storageDomain.encryptionKey.encryptionAlgorithm Algorithm - * used to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} storageDomain.encryptionStatus The encryption status - * "Enabled | Disabled". Possible values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginCreateOrUpdateWithHttpOperationResponse(storageDomainName, storageDomain, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginCreateOrUpdate(storageDomainName, storageDomain, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Creates or updates the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {object} storageDomain The storageDomain. - * - * @param {array} storageDomain.storageAccountCredentialIds The storage account - * credentials. - * - * @param {object} [storageDomain.encryptionKey] The encryption key used to - * encrypt the data. This is a user secret. - * - * @param {string} storageDomain.encryptionKey.value The value of the secret - * itself. If the secret is in plaintext then EncryptionAlgorithm will be none - * and EncryptionCertThumbprint will be null. - * - * @param {string} - * [storageDomain.encryptionKey.encryptionCertificateThumbprint] Thumbprint - * certificate that was used to encrypt "Value" - * - * @param {string} storageDomain.encryptionKey.encryptionAlgorithm Algorithm - * used to encrypt "Value". Possible values include: 'None', 'AES256', - * 'RSAES_PKCS1_v_1_5' - * - * @param {string} storageDomain.encryptionStatus The encryption status - * "Enabled | Disabled". Possible values include: 'Enabled', 'Disabled' - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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 {StorageDomain} - 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 StorageDomain} 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. - */ - beginCreateOrUpdate(storageDomainName, storageDomain, resourceGroupName, managerName, 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._beginCreateOrUpdate(storageDomainName, storageDomain, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginCreateOrUpdate(storageDomainName, storageDomain, resourceGroupName, managerName, options, optionalCallback); - } - } - - /** - * Deletes the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethodWithHttpOperationResponse(storageDomainName, resourceGroupName, managerName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginDeleteMethod(storageDomainName, resourceGroupName, managerName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Deletes the storage domain. - * - * @param {string} storageDomainName The storage domain name. - * - * @param {string} resourceGroupName The resource group name - * - * @param {string} managerName The manager name - * - * @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. - */ - beginDeleteMethod(storageDomainName, resourceGroupName, managerName, 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._beginDeleteMethod(storageDomainName, resourceGroupName, managerName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginDeleteMethod(storageDomainName, resourceGroupName, managerName, options, optionalCallback); - } - } - -} - -module.exports = StorageDomains; diff --git a/lib/services/storSimple1200Series/lib/storSimpleManagementClient.d.ts b/lib/services/storSimple1200Series/lib/storSimpleManagementClient.d.ts deleted file mode 100644 index 7ba07e6deb..0000000000 --- a/lib/services/storSimple1200Series/lib/storSimpleManagementClient.d.ts +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -import { ServiceClientCredentials } from 'ms-rest'; -import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; -import * as models from "./models"; -import * as operations from "./operations"; - -export default class StorSimpleManagementClient extends AzureServiceClient { - /** - * Initializes a new instance of the StorSimpleManagementClient class. - * @constructor - * - * @class - * @param {credentials} credentials - Credentials needed for the client to connect to Azure. - * - * @param {string} subscriptionId - The subscription id - * - * @param {string} [baseUri] - The base URI of the service. - * - * @param {object} [options] - The parameter options - * - * @param {Array} [options.filters] - Filters to be added to the request pipeline - * - * @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] - 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: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); - - credentials: ServiceClientCredentials; - - apiVersion: string; - - subscriptionId: string; - - acceptLanguage: string; - - longRunningOperationRetryTimeout: number; - - generateClientRequestId: boolean; - - // Operation groups - managers: operations.Managers; - availableProviderOperationsOperations: operations.AvailableProviderOperationsOperations; - accessControlRecords: operations.AccessControlRecords; - alerts: operations.Alerts; - backups: operations.Backups; - devices: operations.Devices; - backupScheduleGroups: operations.BackupScheduleGroups; - chapSettingsOperations: operations.ChapSettingsOperations; - iscsiDisks: operations.IscsiDisks; - fileServers: operations.FileServers; - fileShares: operations.FileShares; - iscsiServers: operations.IscsiServers; - jobs: operations.Jobs; - storageAccountCredentials: operations.StorageAccountCredentials; - storageDomains: operations.StorageDomains; -} - -export { StorSimpleManagementClient, models as StorSimpleManagementModels }; diff --git a/lib/services/storSimple1200Series/lib/storSimpleManagementClient.js b/lib/services/storSimple1200Series/lib/storSimpleManagementClient.js deleted file mode 100644 index 7092e24d51..0000000000 --- a/lib/services/storSimple1200Series/lib/storSimpleManagementClient.js +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -/* jshint latedef:false */ -/* jshint forin:false */ -/* jshint noempty:false */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const ServiceClient = msRestAzure.AzureServiceClient; - -const models = require('./models'); -const operations = require('./operations'); - - -/** Class representing a StorSimpleManagementClient. */ -class StorSimpleManagementClient extends ServiceClient { - /** - * Create a StorSimpleManagementClient. - * @param {credentials} credentials - Credentials needed for the client to connect to Azure. - * @param {string} subscriptionId - The subscription id - * @param {string} [baseUri] - The base URI of the service. - * @param {object} [options] - The parameter options - * @param {Array} [options.filters] - Filters to be added to the request pipeline - * @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] - 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) { - throw new Error('\'credentials\' cannot be null.'); - } - if (subscriptionId === null || subscriptionId === undefined) { - throw new Error('\'subscriptionId\' cannot be null.'); - } - - if (!options) options = {}; - - super(credentials, options); - - this.apiVersion = '2016-10-01'; - this.acceptLanguage = 'en-US'; - this.longRunningOperationRetryTimeout = 30; - this.generateClientRequestId = true; - this.baseUri = baseUri; - if (!this.baseUri) { - this.baseUri = 'https://management.azure.com'; - } - this.credentials = credentials; - this.subscriptionId = subscriptionId; - - let packageInfo = this.getPackageJsonInfo(__dirname); - this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { - this.acceptLanguage = options.acceptLanguage; - } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { - this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; - } - if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { - this.generateClientRequestId = options.generateClientRequestId; - } - this.managers = new operations.Managers(this); - this.availableProviderOperationsOperations = new operations.AvailableProviderOperationsOperations(this); - this.accessControlRecords = new operations.AccessControlRecords(this); - this.alerts = new operations.Alerts(this); - this.backups = new operations.Backups(this); - this.devices = new operations.Devices(this); - this.backupScheduleGroups = new operations.BackupScheduleGroups(this); - this.chapSettingsOperations = new operations.ChapSettingsOperations(this); - this.iscsiDisks = new operations.IscsiDisks(this); - this.fileServers = new operations.FileServers(this); - this.fileShares = new operations.FileShares(this); - this.iscsiServers = new operations.IscsiServers(this); - this.jobs = new operations.Jobs(this); - this.storageAccountCredentials = new operations.StorageAccountCredentials(this); - this.storageDomains = new operations.StorageDomains(this); - this.models = models; - msRest.addSerializationMixin(this); - } - -} - -module.exports = StorSimpleManagementClient; -module.exports['default'] = StorSimpleManagementClient; -module.exports.StorSimpleManagementClient = StorSimpleManagementClient; -module.exports.StorSimpleManagementModels = models; diff --git a/lib/services/storSimple1200Series/package.json b/lib/services/storSimple1200Series/package.json deleted file mode 100644 index d807bf118e..0000000000 --- a/lib/services/storSimple1200Series/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "azure-arm-storSimple1200Series", - "author": "Microsoft Corporation", - "description": "StorSimpleManagementClient Library with typescript type definitions for node", - "version": "1.0.0-preview", - "dependencies": { - "ms-rest": "^2.3.3", - "ms-rest-azure": "^2.5.5" - }, - "keywords": [ - "node", - "azure" - ], - "license": "MIT", - "main": "./lib/storSimpleManagementClient.js", - "types": "./lib/storSimpleManagementClient.d.ts", - "homepage": "https://github.com/azure/azure-sdk-for-node", - "repository": { - "type": "git", - "url": "https://github.com/azure/azure-sdk-for-node.git" - }, - "bugs": { - "url": "https://github.com/azure/azure-sdk-for-node/issues" - } -} diff --git a/lib/services/storSimple1200SeriesManagement/package.json b/lib/services/storSimple1200SeriesManagement/package.json index 290b8e3207..2400d2fab1 100644 --- a/lib/services/storSimple1200SeriesManagement/package.json +++ b/lib/services/storSimple1200SeriesManagement/package.json @@ -2,7 +2,7 @@ "name": "azure-arm-storsimple1200series", "author": "Microsoft Corporation", "description": "StorSimpleManagementClient Library with typescript type definitions for node", - "version": "1.0.0", + "version": "1.0.1", "dependencies": { "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5"