diff --git a/lib/services/serviceFabricManagement/LICENSE.txt b/lib/services/serviceFabricManagement/LICENSE.txt index 0313a903d7..5431ba98b9 100644 --- a/lib/services/serviceFabricManagement/LICENSE.txt +++ b/lib/services/serviceFabricManagement/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2017 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +The MIT License (MIT) + +Copyright (c) 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/serviceFabricManagement/README.md b/lib/services/serviceFabricManagement/README.md index 5c8a18fae5..d779190d8d 100644 --- a/lib/services/serviceFabricManagement/README.md +++ b/lib/services/serviceFabricManagement/README.md @@ -1,37 +1,42 @@ -# Microsoft Azure SDK for Node.js - ServiceFabricManagement - -This project provides a Node.js package that makes it easy to manage Microsoft Azure ServiceFabric. -## Minimum node.js version >= 6.x.x - -## How to Install - -```bash -npm install azure-arm-servicefabric -``` - -## How to Use - -### Authentication, client creation and listing clusters as an example - - ```javascript - const msRestAzure = require('ms-rest-azure'); - const ServiceFabricManagement = require("azure-arm-servicefabric"); - - // Interactive Login - // It provides a url and code that needs to be copied and pasted in a browser and authenticated over there. If successful, - // the user will get a DeviceTokenCredentials object. - msRestAzure.interactiveLogin().then((credentials) => { - let client = new ServiceFabricManagement(credentials, 'your-subscription-id'); - return client.clusters.list(); - }).then((clusters) => { - console.log('List of clusters:'); - console.dir(clusters, {depth: null, colors: true}); -}).catch((err) => { - console.log('An error ocurred'); - console.dir(err, {depth: null, colors: true}); - }); -``` - -## Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) \ No newline at end of file +--- +uid: azure-arm-servicefabric +summary: *content + +--- +# Microsoft Azure SDK for Node.js - ServiceFabricManagementClient +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-servicefabric +``` + +## How to use + +### Authentication, client creation and get clusters as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const ServiceFabricManagementClient = require("azure-arm-servicefabric"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new ServiceFabricManagementClient(creds, subscriptionId); + const resourceGroupName = "testresourceGroupName"; + const clusterName = "testclusterName"; + return client.clusters.get(resourceGroupName, clusterName).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/serviceFabricManagement/lib/models/applicationDeltaHealthPolicy.js b/lib/services/serviceFabricManagement/lib/models/applicationDeltaHealthPolicy.js new file mode 100644 index 0000000000..29f4483300 --- /dev/null +++ b/lib/services/serviceFabricManagement/lib/models/applicationDeltaHealthPolicy.js @@ -0,0 +1,86 @@ +/* + * 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'); + +/** + * Defines a delta health policy used to evaluate the health of an application + * or one of its child entities when upgrading the cluster. + * + * + */ +class ApplicationDeltaHealthPolicy { + /** + * Create a ApplicationDeltaHealthPolicy. + * @member {object} [defaultServiceTypeDeltaHealthPolicy] The delta health + * policy used by default to evaluate the health of a service type when + * upgrading the cluster. + * @member {number} + * [defaultServiceTypeDeltaHealthPolicy.maxPercentDeltaUnhealthyServices] The + * maximum allowed percentage of services health degradation allowed during + * cluster upgrades. + * The delta is measured between the state of the services at the beginning + * of upgrade and the state of the services at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to + * make sure the global state of the cluster is within tolerated limits. + * @member {object} [serviceTypeDeltaHealthPolicies] The map with service + * type delta health policy per service type name. The map is empty by + * default. + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationDeltaHealthPolicy + * + * @returns {object} metadata of ApplicationDeltaHealthPolicy + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationDeltaHealthPolicy', + type: { + name: 'Composite', + className: 'ApplicationDeltaHealthPolicy', + modelProperties: { + defaultServiceTypeDeltaHealthPolicy: { + required: false, + serializedName: 'defaultServiceTypeDeltaHealthPolicy', + type: { + name: 'Composite', + className: 'ServiceTypeDeltaHealthPolicy' + } + }, + serviceTypeDeltaHealthPolicies: { + required: false, + serializedName: 'serviceTypeDeltaHealthPolicies', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'ServiceTypeDeltaHealthPolicyElementType', + type: { + name: 'Composite', + className: 'ServiceTypeDeltaHealthPolicy' + } + } + } + } + } + } + }; + } +} + +module.exports = ApplicationDeltaHealthPolicy; diff --git a/lib/services/serviceFabricManagement/lib/models/applicationHealthPolicy.js b/lib/services/serviceFabricManagement/lib/models/applicationHealthPolicy.js index f26e60a3e7..225571a993 100644 --- a/lib/services/serviceFabricManagement/lib/models/applicationHealthPolicy.js +++ b/lib/services/serviceFabricManagement/lib/models/applicationHealthPolicy.js @@ -21,6 +21,14 @@ const models = require('./index'); class ApplicationHealthPolicy { /** * Create a ApplicationHealthPolicy. + * @member {object} [defaultServiceTypeHealthPolicy] The health policy used + * by default to evaluate the health of a service type. + * @member {number} + * [defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] The maximum + * percentage of services allowed to be unhealthy before your application is + * considered in error. + * @member {object} [serviceTypeHealthPolicies] The map with service type + * health policy per service type name. The map is empty by default. * @member {boolean} [considerWarningAsError] Indicates whether warnings are * treated with the same severity as errors. Default value: false . * @member {number} [maxPercentUnhealthyDeployedApplications] The maximum @@ -35,48 +43,14 @@ class ApplicationHealthPolicy { * The computation rounds up to tolerate one failure on small numbers of * nodes. Default percentage is zero. * . Default value: 0 . - * @member {object} [defaultServiceTypeHealthPolicy] - * @member {number} - * [defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. - * Allowed values are Byte values from zero to 100 - * - * The percentage represents the maximum tolerated percentage of partitions - * that can be unhealthy before the service is considered in error. - * If the percentage is respected but there is at least one unhealthy - * partition, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy - * partitions over the total number of partitions in the service. - * The computation rounds up to tolerate one failure on small numbers of - * partitions. Default percentage is zero. - * @member {number} - * [defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. - * Allowed values are Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of replicas - * that can be unhealthy before the partition is considered in error. - * If the percentage is respected but there is at least one unhealthy - * replica, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy replicas - * over the total number of replicas in the partition. - * The computation rounds up to tolerate one failure on small numbers of - * replicas. Default percentage is zero. + * @member {object} [defaultServiceTypeHealthPolicy1] The health policy used + * by default to evaluate the health of a service type. * @member {number} - * [defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] The maximum - * maximum allowed percentage of unhealthy services. Allowed values are Byte - * values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of services - * that can be unhealthy before the application is considered in error. - * If the percentage is respected but there is at least one unhealthy - * service, the health is evaluated as Warning. - * This is calculated by dividing the number of unhealthy services of the - * specific service type over the total number of services of the specific - * service type. - * The computation rounds up to tolerate one failure on small numbers of - * services. Default percentage is zero. - * @member {array} [serviceTypeHealthPolicyMap] + * [defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] The maximum + * percentage of services allowed to be unhealthy before your application is + * considered in error. + * @member {object} [serviceTypeHealthPolicyMap] The map with service type + * health policy per service type name. The map is empty by default. */ constructor() { } @@ -95,6 +69,29 @@ class ApplicationHealthPolicy { name: 'Composite', className: 'ApplicationHealthPolicy', modelProperties: { + defaultServiceTypeHealthPolicy: { + required: false, + serializedName: 'defaultServiceTypeHealthPolicy', + type: { + name: 'Composite', + className: 'ServiceTypeHealthPolicy' + } + }, + serviceTypeHealthPolicies: { + required: false, + serializedName: 'serviceTypeHealthPolicies', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'ServiceTypeHealthPolicyElementType', + type: { + name: 'Composite', + className: 'ServiceTypeHealthPolicy' + } + } + } + }, considerWarningAsError: { required: false, serializedName: 'ConsiderWarningAsError', @@ -111,7 +108,7 @@ class ApplicationHealthPolicy { name: 'Number' } }, - defaultServiceTypeHealthPolicy: { + defaultServiceTypeHealthPolicy1: { required: false, serializedName: 'DefaultServiceTypeHealthPolicy', type: { @@ -123,13 +120,13 @@ class ApplicationHealthPolicy { required: false, serializedName: 'ServiceTypeHealthPolicyMap', type: { - name: 'Sequence', - element: { + name: 'Dictionary', + value: { required: false, - serializedName: 'ServiceTypeHealthPolicyMapItemElementType', + serializedName: 'ServiceTypeHealthPolicyElementType', type: { name: 'Composite', - className: 'ServiceTypeHealthPolicyMapItem' + className: 'ServiceTypeHealthPolicy' } } } diff --git a/lib/services/serviceFabricManagement/lib/models/applicationResource.js b/lib/services/serviceFabricManagement/lib/models/applicationResource.js index 0079befe5d..d1bce443b0 100644 --- a/lib/services/serviceFabricManagement/lib/models/applicationResource.js +++ b/lib/services/serviceFabricManagement/lib/models/applicationResource.js @@ -20,23 +20,70 @@ const models = require('./index'); class ApplicationResource extends models['ProxyResource'] { /** * Create a ApplicationResource. - * @member {string} [typeVersion] - * @member {array} [parameters] - * @member {object} [upgradePolicy] - * @member {number} [upgradePolicy.upgradeReplicaSetCheckTimeout] - * @member {boolean} [upgradePolicy.forceRestart] - * @member {object} [upgradePolicy.rollingUpgradeMonitoringPolicy] + * @member {string} [typeVersion] The version of the application type as + * defined in the application manifest. + * @member {object} [parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * @member {object} [upgradePolicy] Describes the policy for a monitored + * application upgrade. + * @member {number} [upgradePolicy.upgradeReplicaSetCheckTimeout] The maximum + * amount of time to block processing of an upgrade domain and prevent loss + * of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each + * upgrade domain. Valid values are between 0 and 42949672925 inclusive. + * (unsigned 32-bit integer). + * @member {boolean} [upgradePolicy.forceRestart] If true, then processes are + * forcefully restarted during upgrade even when the code version has not + * changed (the upgrade only changes configuration or data). + * @member {object} [upgradePolicy.rollingUpgradeMonitoringPolicy] The policy + * used for monitoring the application upgrade * @member {string} - * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] The + * amount of time to wait after completing an upgrade domain before applying + * health policies. It is first interpreted as a string representing an ISO + * 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. * @member {string} * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. * @member {string} - * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] The + * amount of time to retry health evaluation when the application or cluster + * is unhealthy before FailureAction is executed. It is first interpreted as + * a string representing an ISO 8601 duration. If that fails, then it is + * interpreted as a number representing the total number of milliseconds. * @member {string} - * [upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] + * [upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The amount + * of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing + * the total number of milliseconds. * @member {string} - * [upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] - * @member {object} [upgradePolicy.applicationHealthPolicy] + * [upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] The + * amount of time each upgrade domain has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing + * the total number of milliseconds. + * @member {object} [upgradePolicy.applicationHealthPolicy] Defines a health + * policy used to evaluate the health of an application or one of its + * children entities. + * @member {object} + * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The + * health policy used by default to evaluate the health of a service type. + * @member {number} + * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * @member {object} + * [upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] The map + * with service type health policy per service type name. The map is empty by + * default. * @member {boolean} * [upgradePolicy.applicationHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. @@ -53,49 +100,17 @@ class ApplicationResource extends models['ProxyResource'] { * The computation rounds up to tolerate one failure on small numbers of * nodes. Default percentage is zero. * @member {object} - * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * @member {number} - * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. - * Allowed values are Byte values from zero to 100 - * - * The percentage represents the maximum tolerated percentage of partitions - * that can be unhealthy before the service is considered in error. - * If the percentage is respected but there is at least one unhealthy - * partition, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy - * partitions over the total number of partitions in the service. - * The computation rounds up to tolerate one failure on small numbers of - * partitions. Default percentage is zero. - * @member {number} - * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. - * Allowed values are Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of replicas - * that can be unhealthy before the partition is considered in error. - * If the percentage is respected but there is at least one unhealthy - * replica, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy replicas - * over the total number of replicas in the partition. - * The computation rounds up to tolerate one failure on small numbers of - * replicas. Default percentage is zero. + * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service + * type. * @member {number} - * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed - * values are Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of services - * that can be unhealthy before the application is considered in error. - * If the percentage is respected but there is at least one unhealthy - * service, the health is evaluated as Warning. - * This is calculated by dividing the number of unhealthy services of the - * specific service type over the total number of services of the specific - * service type. - * The computation rounds up to tolerate one failure on small numbers of - * services. Default percentage is zero. - * @member {array} - * [upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * @member {object} + * [upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] The map + * with service type health policy per service type name. The map is empty by + * default. * @member {number} [minimumNodes] The minimum number of nodes where Service * Fabric will reserve capacity for this application. Note that this does not * mean that the services of this application will be placed on all of those @@ -107,12 +122,13 @@ class ApplicationResource extends models['ProxyResource'] { * mean that the services of this application will be placed on all of those * nodes. By default, the value of this property is zero and it means that * the services can be placed on any node. Default value: 0 . - * @member {boolean} [removeApplicationCapacity] The version of the - * application type - * @member {array} [metrics] + * @member {boolean} [removeApplicationCapacity] Remove the current + * application capacity settings. + * @member {array} [metrics] List of application capacity metric description. * @member {string} [provisioningState] The current deployment or * provisioning state, which only appears in the response - * @member {string} [typeName] + * @member {string} [typeName] The application type name as defined in the + * application manifest. */ constructor() { super(); @@ -157,7 +173,7 @@ class ApplicationResource extends models['ProxyResource'] { } }, location: { - required: true, + required: false, serializedName: 'location', type: { name: 'String' @@ -174,13 +190,12 @@ class ApplicationResource extends models['ProxyResource'] { required: false, serializedName: 'properties.parameters', type: { - name: 'Sequence', - element: { + name: 'Dictionary', + value: { required: false, - serializedName: 'ApplicationParameterElementType', + serializedName: 'StringElementType', type: { - name: 'Composite', - className: 'ApplicationParameter' + name: 'String' } } } diff --git a/lib/services/serviceFabricManagement/lib/models/applicationResourceUpdate.js b/lib/services/serviceFabricManagement/lib/models/applicationResourceUpdate.js index 324b3722ba..0219b21cb2 100644 --- a/lib/services/serviceFabricManagement/lib/models/applicationResourceUpdate.js +++ b/lib/services/serviceFabricManagement/lib/models/applicationResourceUpdate.js @@ -20,23 +20,70 @@ const models = require('./index'); class ApplicationResourceUpdate extends models['ProxyResource'] { /** * Create a ApplicationResourceUpdate. - * @member {string} [typeVersion] - * @member {array} [parameters] - * @member {object} [upgradePolicy] - * @member {number} [upgradePolicy.upgradeReplicaSetCheckTimeout] - * @member {boolean} [upgradePolicy.forceRestart] - * @member {object} [upgradePolicy.rollingUpgradeMonitoringPolicy] + * @member {string} [typeVersion] The version of the application type as + * defined in the application manifest. + * @member {object} [parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * @member {object} [upgradePolicy] Describes the policy for a monitored + * application upgrade. + * @member {number} [upgradePolicy.upgradeReplicaSetCheckTimeout] The maximum + * amount of time to block processing of an upgrade domain and prevent loss + * of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each + * upgrade domain. Valid values are between 0 and 42949672925 inclusive. + * (unsigned 32-bit integer). + * @member {boolean} [upgradePolicy.forceRestart] If true, then processes are + * forcefully restarted during upgrade even when the code version has not + * changed (the upgrade only changes configuration or data). + * @member {object} [upgradePolicy.rollingUpgradeMonitoringPolicy] The policy + * used for monitoring the application upgrade * @member {string} - * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] The + * amount of time to wait after completing an upgrade domain before applying + * health policies. It is first interpreted as a string representing an ISO + * 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. * @member {string} * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. * @member {string} - * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] The + * amount of time to retry health evaluation when the application or cluster + * is unhealthy before FailureAction is executed. It is first interpreted as + * a string representing an ISO 8601 duration. If that fails, then it is + * interpreted as a number representing the total number of milliseconds. * @member {string} - * [upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] + * [upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The amount + * of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing + * the total number of milliseconds. * @member {string} - * [upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] - * @member {object} [upgradePolicy.applicationHealthPolicy] + * [upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] The + * amount of time each upgrade domain has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing + * the total number of milliseconds. + * @member {object} [upgradePolicy.applicationHealthPolicy] Defines a health + * policy used to evaluate the health of an application or one of its + * children entities. + * @member {object} + * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The + * health policy used by default to evaluate the health of a service type. + * @member {number} + * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * @member {object} + * [upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] The map + * with service type health policy per service type name. The map is empty by + * default. * @member {boolean} * [upgradePolicy.applicationHealthPolicy.considerWarningAsError] Indicates * whether warnings are treated with the same severity as errors. @@ -53,49 +100,17 @@ class ApplicationResourceUpdate extends models['ProxyResource'] { * The computation rounds up to tolerate one failure on small numbers of * nodes. Default percentage is zero. * @member {object} - * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * @member {number} - * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. - * Allowed values are Byte values from zero to 100 - * - * The percentage represents the maximum tolerated percentage of partitions - * that can be unhealthy before the service is considered in error. - * If the percentage is respected but there is at least one unhealthy - * partition, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy - * partitions over the total number of partitions in the service. - * The computation rounds up to tolerate one failure on small numbers of - * partitions. Default percentage is zero. - * @member {number} - * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. - * Allowed values are Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of replicas - * that can be unhealthy before the partition is considered in error. - * If the percentage is respected but there is at least one unhealthy - * replica, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy replicas - * over the total number of replicas in the partition. - * The computation rounds up to tolerate one failure on small numbers of - * replicas. Default percentage is zero. + * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service + * type. * @member {number} - * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed - * values are Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of services - * that can be unhealthy before the application is considered in error. - * If the percentage is respected but there is at least one unhealthy - * service, the health is evaluated as Warning. - * This is calculated by dividing the number of unhealthy services of the - * specific service type over the total number of services of the specific - * service type. - * The computation rounds up to tolerate one failure on small numbers of - * services. Default percentage is zero. - * @member {array} - * [upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * @member {object} + * [upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] The map + * with service type health policy per service type name. The map is empty by + * default. * @member {number} [minimumNodes] The minimum number of nodes where Service * Fabric will reserve capacity for this application. Note that this does not * mean that the services of this application will be placed on all of those @@ -107,9 +122,9 @@ class ApplicationResourceUpdate extends models['ProxyResource'] { * mean that the services of this application will be placed on all of those * nodes. By default, the value of this property is zero and it means that * the services can be placed on any node. Default value: 0 . - * @member {boolean} [removeApplicationCapacity] The version of the - * application type - * @member {array} [metrics] + * @member {boolean} [removeApplicationCapacity] Remove the current + * application capacity settings. + * @member {array} [metrics] List of application capacity metric description. */ constructor() { super(); @@ -154,7 +169,7 @@ class ApplicationResourceUpdate extends models['ProxyResource'] { } }, location: { - required: true, + required: false, serializedName: 'location', type: { name: 'String' @@ -171,13 +186,12 @@ class ApplicationResourceUpdate extends models['ProxyResource'] { required: false, serializedName: 'properties.parameters', type: { - name: 'Sequence', - element: { + name: 'Dictionary', + value: { required: false, - serializedName: 'ApplicationParameterElementType', + serializedName: 'StringElementType', type: { - name: 'Composite', - className: 'ApplicationParameter' + name: 'String' } } } diff --git a/lib/services/serviceFabricManagement/lib/models/applicationTypeResource.js b/lib/services/serviceFabricManagement/lib/models/applicationTypeResource.js index c28764032c..31337d813f 100644 --- a/lib/services/serviceFabricManagement/lib/models/applicationTypeResource.js +++ b/lib/services/serviceFabricManagement/lib/models/applicationTypeResource.js @@ -66,7 +66,7 @@ class ApplicationTypeResource extends models['ProxyResource'] { } }, location: { - required: true, + required: false, serializedName: 'location', type: { name: 'String' diff --git a/lib/services/serviceFabricManagement/lib/models/applicationTypeVersionResource.js b/lib/services/serviceFabricManagement/lib/models/applicationTypeVersionResource.js new file mode 100644 index 0000000000..9892e8115d --- /dev/null +++ b/lib/services/serviceFabricManagement/lib/models/applicationTypeVersionResource.js @@ -0,0 +1,116 @@ +/* + * 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'); + +/** + * An application type version resource for the specified application type name + * resource. + * + * @extends models['ProxyResource'] + */ +class ApplicationTypeVersionResource extends models['ProxyResource'] { + /** + * Create a ApplicationTypeVersionResource. + * @member {string} [provisioningState] The current deployment or + * provisioning state, which only appears in the response + * @member {string} appPackageUrl The URL to the application package + * @member {object} [defaultParameterList] List of application type + * parameters that can be overridden when creating or updating the + * application. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ApplicationTypeVersionResource + * + * @returns {object} metadata of ApplicationTypeVersionResource + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationTypeVersionResource', + type: { + name: 'Composite', + className: 'ApplicationTypeVersionResource', + 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: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + appPackageUrl: { + required: true, + serializedName: 'properties.appPackageUrl', + type: { + name: 'String' + } + }, + defaultParameterList: { + required: false, + readOnly: true, + serializedName: 'properties.defaultParameterList', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = ApplicationTypeVersionResource; diff --git a/lib/services/serviceFabricManagement/lib/models/applicationTypeVersionResourceList.js b/lib/services/serviceFabricManagement/lib/models/applicationTypeVersionResourceList.js new file mode 100644 index 0000000000..019c5e3b2d --- /dev/null +++ b/lib/services/serviceFabricManagement/lib/models/applicationTypeVersionResourceList.js @@ -0,0 +1,63 @@ +/* + * 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 list of application type version resources for the specified application + * type name resource. + * + */ +class ApplicationTypeVersionResourceList { + /** + * Create a ApplicationTypeVersionResourceList. + * @member {array} [value] + */ + constructor() { + } + + /** + * Defines the metadata of ApplicationTypeVersionResourceList + * + * @returns {object} metadata of ApplicationTypeVersionResourceList + * + */ + mapper() { + return { + required: false, + serializedName: 'ApplicationTypeVersionResourceList', + type: { + name: 'Composite', + className: 'ApplicationTypeVersionResourceList', + modelProperties: { + value: { + required: false, + serializedName: 'value', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ApplicationTypeVersionResourceElementType', + type: { + name: 'Composite', + className: 'ApplicationTypeVersionResource' + } + } + } + } + } + } + }; + } +} + +module.exports = ApplicationTypeVersionResourceList; diff --git a/lib/services/serviceFabricManagement/lib/models/applicationUpgradePolicy.js b/lib/services/serviceFabricManagement/lib/models/applicationUpgradePolicy.js index 22ad751e55..18bcd37a0e 100644 --- a/lib/services/serviceFabricManagement/lib/models/applicationUpgradePolicy.js +++ b/lib/services/serviceFabricManagement/lib/models/applicationUpgradePolicy.js @@ -13,22 +13,63 @@ const models = require('./index'); /** - * The application upgrade policy. + * Describes the policy for a monitored application upgrade. * */ class ApplicationUpgradePolicy { /** * Create a ApplicationUpgradePolicy. - * @member {number} [upgradeReplicaSetCheckTimeout] - * @member {boolean} [forceRestart] - * @member {object} [rollingUpgradeMonitoringPolicy] + * @member {number} [upgradeReplicaSetCheckTimeout] The maximum amount of + * time to block processing of an upgrade domain and prevent loss of + * availability when there are unexpected issues. When this timeout expires, + * processing of the upgrade domain will proceed regardless of availability + * loss issues. The timeout is reset at the start of each upgrade domain. + * Valid values are between 0 and 42949672925 inclusive. (unsigned 32-bit + * integer). + * @member {boolean} [forceRestart] If true, then processes are forcefully + * restarted during upgrade even when the code version has not changed (the + * upgrade only changes configuration or data). + * @member {object} [rollingUpgradeMonitoringPolicy] The policy used for + * monitoring the application upgrade * @member {string} [rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. * @member {string} - * [rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * [rollingUpgradeMonitoringPolicy.healthCheckStableDuration] The amount of + * time that the application or cluster must remain healthy before the + * upgrade proceeds to the next upgrade domain. It is first interpreted as a + * string representing an ISO 8601 duration. If that fails, then it is + * interpreted as a number representing the total number of milliseconds. * @member {string} [rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] - * @member {string} [rollingUpgradeMonitoringPolicy.upgradeTimeout] - * @member {string} [rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] - * @member {object} [applicationHealthPolicy] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * @member {string} [rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing + * the total number of milliseconds. + * @member {string} [rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] The + * amount of time each upgrade domain has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing + * the total number of milliseconds. + * @member {object} [applicationHealthPolicy] Defines a health policy used to + * evaluate the health of an application or one of its children entities. + * @member {object} [applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service + * type. + * @member {number} + * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * @member {object} [applicationHealthPolicy.serviceTypeHealthPolicies] The + * map with service type health policy per service type name. The map is + * empty by default. * @member {boolean} [applicationHealthPolicy.considerWarningAsError] * Indicates whether warnings are treated with the same severity as errors. * @member {number} @@ -43,48 +84,16 @@ class ApplicationUpgradePolicy { * deployed on in the cluster. * The computation rounds up to tolerate one failure on small numbers of * nodes. Default percentage is zero. - * @member {object} [applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * @member {number} - * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. - * Allowed values are Byte values from zero to 100 - * - * The percentage represents the maximum tolerated percentage of partitions - * that can be unhealthy before the service is considered in error. - * If the percentage is respected but there is at least one unhealthy - * partition, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy - * partitions over the total number of partitions in the service. - * The computation rounds up to tolerate one failure on small numbers of - * partitions. Default percentage is zero. + * @member {object} [applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service + * type. * @member {number} - * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. - * Allowed values are Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of replicas - * that can be unhealthy before the partition is considered in error. - * If the percentage is respected but there is at least one unhealthy - * replica, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy replicas - * over the total number of replicas in the partition. - * The computation rounds up to tolerate one failure on small numbers of - * replicas. Default percentage is zero. - * @member {number} - * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed - * values are Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of services - * that can be unhealthy before the application is considered in error. - * If the percentage is respected but there is at least one unhealthy - * service, the health is evaluated as Warning. - * This is calculated by dividing the number of unhealthy services of the - * specific service type over the total number of services of the specific - * service type. - * The computation rounds up to tolerate one failure on small numbers of - * services. Default percentage is zero. - * @member {array} [applicationHealthPolicy.serviceTypeHealthPolicyMap] + * [applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * @member {object} [applicationHealthPolicy.serviceTypeHealthPolicyMap] The + * map with service type health policy per service type name. The map is + * empty by default. */ constructor() { } diff --git a/lib/services/serviceFabricManagement/lib/models/cluster.js b/lib/services/serviceFabricManagement/lib/models/cluster.js index 33529488fe..44d5f33a49 100644 --- a/lib/services/serviceFabricManagement/lib/models/cluster.js +++ b/lib/services/serviceFabricManagement/lib/models/cluster.js @@ -21,27 +21,22 @@ const models = require('./index'); class Cluster extends models['Resource'] { /** * Create a Cluster. + * @member {array} [addOnFeatures] The list of add-on features to enable in + * the cluster. * @member {array} [availableClusterVersions] The Service Fabric runtime * versions available for this cluster. - * @member {string} [clusterId] A service generated unique identifier for the - * cluster resource. - * @member {string} [clusterState] Possible values include: - * 'WaitingForNodes', 'Deploying', 'BaselineUpgrade', - * 'UpdatingUserConfiguration', 'UpdatingUserCertificate', - * 'UpdatingInfrastructure', 'EnforcingClusterVersion', - * 'UpgradeServiceUnreachable', 'AutoScale', 'Ready' - * @member {string} [clusterEndpoint] The Azure Resource Provider endpoint. A - * system service in the cluster connects to this endpoint. - * @member {string} [clusterCodeVersion] The Service Fabric runtime version - * of the cluster. This property can only by set the user when - * **upgradeMode** is set to 'Manual'. To get list of available Service - * Fabric versions for new clusters use [ClusterVersion - * API](./ClusterVersion.md). To get the list of available version for - * existing clusters use **availableClusterVersions**. + * @member {object} [azureActiveDirectory] The AAD authentication settings of + * the cluster. + * @member {string} [azureActiveDirectory.tenantId] Azure active directory + * tenant id. + * @member {string} [azureActiveDirectory.clusterApplication] Azure active + * directory cluster application id. + * @member {string} [azureActiveDirectory.clientApplication] Azure active + * directory client application id. * @member {object} [certificate] The certificate to use for securing the - * cluster. The certificate provided will be used for node to node security + * cluster. The certificate provided will be used for node to node security * within the cluster, SSL certificate for cluster management endpoint and - * default admin client. + * default admin client. * @member {string} [certificate.thumbprint] Thumbprint of the primary * certificate. * @member {string} [certificate.thumbprintSecondary] Thumbprint of the @@ -50,44 +45,63 @@ class Cluster extends models['Resource'] { * location. Possible values include: 'AddressBook', 'AuthRoot', * 'CertificateAuthority', 'Disallowed', 'My', 'Root', 'TrustedPeople', * 'TrustedPublisher' - * @member {string} [reliabilityLevel] Possible values include: 'None', - * 'Bronze', 'Silver', 'Gold', 'Platinum' - * @member {string} [upgradeMode] Possible values include: 'Automatic', - * 'Manual' - * @member {array} [clientCertificateThumbprints] The list of client - * certificates referenced by thumbprint that are allowed to manage the + * @member {object} [certificateCommonNames] Describes a list of server + * certificates referenced by common name that are used to secure the * cluster. - * @member {array} [clientCertificateCommonNames] The list of client - * certificates referenced by common name that are allowed to manage the + * @member {array} [certificateCommonNames.commonNames] The list of server + * certificates referenced by common name that are used to secure the * cluster. - * @member {array} [fabricSettings] The list of custom fabric settings to - * configure the cluster. - * @member {object} [reverseProxyCertificate] The server certificate used by - * reverse proxy. - * @member {string} [reverseProxyCertificate.thumbprint] Thumbprint of the - * primary certificate. - * @member {string} [reverseProxyCertificate.thumbprintSecondary] Thumbprint - * of the secondary certificate. - * @member {string} [reverseProxyCertificate.x509StoreName] The local + * @member {string} [certificateCommonNames.x509StoreName] The local * certificate store location. Possible values include: 'AddressBook', * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', * 'TrustedPeople', 'TrustedPublisher' - * @member {string} managementEndpoint The http management endpoint of the + * @member {array} [clientCertificateCommonNames] The list of client + * certificates referenced by common name that are allowed to manage the * cluster. - * @member {array} nodeTypes The list of node types in the cluster. - * @member {object} [azureActiveDirectory] The AAD authentication settings of - * the cluster. - * @member {string} [azureActiveDirectory.tenantId] Azure active directory - * tenant id. - * @member {string} [azureActiveDirectory.clusterApplication] Azure active - * directory cluster application id. - * @member {string} [azureActiveDirectory.clientApplication] Azure active - * directory client application id. - * @member {string} [provisioningState] The provisioning state of the cluster - * resource. Possible values include: 'Updating', 'Succeeded', 'Failed', - * 'Canceled' - * @member {string} [vmImage] The VM image VMSS has been configured with. - * Generic names such as Windows or Linux can be used. + * @member {array} [clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. + * @member {string} [clusterCodeVersion] The Service Fabric runtime version + * of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service + * Fabric versions for new clusters use [ClusterVersion + * API](./ClusterVersion.md). To get the list of available version for + * existing clusters use **availableClusterVersions**. + * @member {string} [clusterEndpoint] The Azure Resource Provider endpoint. A + * system service in the cluster connects to this endpoint. + * @member {string} [clusterId] A service generated unique identifier for the + * cluster resource. + * @member {string} [clusterState] The current state of the cluster. + * + * - WaitingForNodes - Indicates that the cluster resource is created and the + * resource provider is waiting for Service Fabric VM extension to boot up + * and report to it. + * - Deploying - Indicates that the Service Fabric runtime is being installed + * on the VMs. Cluster resource will be in this state until the cluster boots + * up and system services are up. + * - BaselineUpgrade - Indicates that the cluster is upgrading to establishes + * the cluster version. This upgrade is automatically initiated when the + * cluster boots up for the first time. + * - UpdatingUserConfiguration - Indicates that the cluster is being upgraded + * with the user provided configuration. + * - UpdatingUserCertificate - Indicates that the cluster is being upgraded + * with the user provided certificate. + * - UpdatingInfrastructure - Indicates that the cluster is being upgraded + * with the latest Service Fabric runtime version. This happens only when the + * **upgradeMode** is set to 'Automatic'. + * - EnforcingClusterVersion - Indicates that cluster is on a different + * version than expected and the cluster is being upgraded to the expected + * version. + * - UpgradeServiceUnreachable - Indicates that the system service in the + * cluster is no longer polling the Resource Provider. Clusters in this state + * cannot be managed by the Resource Provider. + * - AutoScale - Indicates that the ReliabilityLevel of the cluster is being + * adjusted. + * - Ready - Indicates that the cluster is in a stable state. + * . Possible values include: 'WaitingForNodes', 'Deploying', + * 'BaselineUpgrade', 'UpdatingUserConfiguration', 'UpdatingUserCertificate', + * 'UpdatingInfrastructure', 'EnforcingClusterVersion', + * 'UpgradeServiceUnreachable', 'AutoScale', 'Ready' * @member {object} [diagnosticsStorageAccountConfig] The storage account * information for storing Service Fabric diagnostic logs. * @member {string} [diagnosticsStorageAccountConfig.storageAccountName] The @@ -100,6 +114,46 @@ class Cluster extends models['Resource'] { * endpoint of the azure storage account. * @member {string} [diagnosticsStorageAccountConfig.tableEndpoint] The table * endpoint of the azure storage account. + * @member {array} [fabricSettings] The list of custom fabric settings to + * configure the cluster. + * @member {string} managementEndpoint The http management endpoint of the + * cluster. + * @member {array} nodeTypes The list of node types in the cluster. + * @member {string} [provisioningState] The provisioning state of the cluster + * resource. Possible values include: 'Updating', 'Succeeded', 'Failed', + * 'Canceled' + * @member {string} [reliabilityLevel] The reliability level sets the replica + * set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + * + * - None - Run the System services with a target replica set count of 1. + * This should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' + * @member {object} [reverseProxyCertificate] The server certificate used by + * reverse proxy. + * @member {string} [reverseProxyCertificate.thumbprint] Thumbprint of the + * primary certificate. + * @member {string} [reverseProxyCertificate.thumbprintSecondary] Thumbprint + * of the secondary certificate. + * @member {string} [reverseProxyCertificate.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' + * @member {object} [reverseProxyCertificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the + * cluster. + * @member {array} [reverseProxyCertificateCommonNames.commonNames] The list + * of server certificates referenced by common name that are used to secure + * the cluster. + * @member {string} [reverseProxyCertificateCommonNames.x509StoreName] The + * local certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * @member {object} [upgradeDescription] The policy to use when upgrading the * cluster. * @member {boolean} [upgradeDescription.forceRestart] If true, then @@ -136,41 +190,84 @@ class Cluster extends models['Resource'] { * [upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The maximum * allowed percentage of unhealthy nodes before reporting an error. For * example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that + * can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, + * the health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes + * over the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of + * nodes. Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. * @member {number} * [upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] The * maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this * value would be 10. - * @member {object} [upgradeDescription.deltaHealthPolicy] The delta health - * policy used when upgrading the cluster. + * + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over + * the total number of application instances in the cluster, excluding + * applications of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * @member {object} + * [upgradeDescription.healthPolicy.applicationHealthPolicies] Defines the + * application health policy map used to evaluate the health of an + * application or one of its children entities. + * @member {object} [upgradeDescription.deltaHealthPolicy] The cluster delta + * health policy used when upgrading the cluster. * @member {number} * [upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes] The * maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain - * upgrade completion to make sure the global state of the cluster is within - * tolerated limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to + * make sure the global state of the cluster is within tolerated limits. * @member {number} * [upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes] * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state - * of the upgrade domain nodes at the beginning of upgrade and the state of - * the upgrade domain nodes at the time of the health evaluation. The check - * is performed after every upgrade domain upgrade completion for all - * completed upgrade domains to make sure the state of the upgrade domains is - * within tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for + * all completed upgrade domains to make sure the state of the upgrade + * domains is within tolerated limits. * @member {number} * [upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications] * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. - * @member {array} [addOnFeatures] The list of add-on features to enable in - * the cluster. + * during cluster upgrades. + * The delta is measured between the state of the applications at the + * beginning of upgrade and the state of the applications at the time of the + * health evaluation. + * The check is performed after every upgrade domain upgrade completion to + * make sure the global state of the cluster is within tolerated limits. + * System services are not included in this. + * @member {object} + * [upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the + * health of an application or one of its child entities when upgrading the + * cluster. + * @member {string} [upgradeMode] The upgrade mode of the cluster when new + * Service Fabric runtime version is available. + * + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' + * @member {string} [vmImage] The VM image VMSS has been configured with. + * Generic names such as Windows or Linux can be used. */ constructor() { super(); @@ -235,49 +332,42 @@ class Cluster extends models['Resource'] { } } }, - availableClusterVersions: { + addOnFeatures: { required: false, - serializedName: 'properties.availableClusterVersions', + serializedName: 'properties.addOnFeatures', type: { name: 'Sequence', element: { required: false, - serializedName: 'ClusterVersionDetailsElementType', + serializedName: 'StringElementType', type: { - name: 'Composite', - className: 'ClusterVersionDetails' + name: 'String' } } } }, - clusterId: { - required: false, - readOnly: true, - serializedName: 'properties.clusterId', - type: { - name: 'String' - } - }, - clusterState: { - required: false, - serializedName: 'properties.clusterState', - type: { - name: 'String' - } - }, - clusterEndpoint: { + availableClusterVersions: { required: false, readOnly: true, - serializedName: 'properties.clusterEndpoint', + serializedName: 'properties.availableClusterVersions', type: { - name: 'String' + name: 'Sequence', + element: { + required: false, + serializedName: 'ClusterVersionDetailsElementType', + type: { + name: 'Composite', + className: 'ClusterVersionDetails' + } + } } }, - clusterCodeVersion: { + azureActiveDirectory: { required: false, - serializedName: 'properties.clusterCodeVersion', + serializedName: 'properties.azureActiveDirectory', type: { - name: 'String' + name: 'Composite', + className: 'AzureActiveDirectory' } }, certificate: { @@ -288,18 +378,27 @@ class Cluster extends models['Resource'] { className: 'CertificateDescription' } }, - reliabilityLevel: { + certificateCommonNames: { required: false, - serializedName: 'properties.reliabilityLevel', + serializedName: 'properties.certificateCommonNames', type: { - name: 'String' + name: 'Composite', + className: 'ServerCertificateCommonNames' } }, - upgradeMode: { + clientCertificateCommonNames: { required: false, - serializedName: 'properties.upgradeMode', + serializedName: 'properties.clientCertificateCommonNames', type: { - name: 'String' + name: 'Sequence', + element: { + required: false, + serializedName: 'ClientCertificateCommonNameElementType', + type: { + name: 'Composite', + className: 'ClientCertificateCommonName' + } + } } }, clientCertificateThumbprints: { @@ -317,19 +416,43 @@ class Cluster extends models['Resource'] { } } }, - clientCertificateCommonNames: { + clusterCodeVersion: { required: false, - serializedName: 'properties.clientCertificateCommonNames', + serializedName: 'properties.clusterCodeVersion', type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'ClientCertificateCommonNameElementType', - type: { - name: 'Composite', - className: 'ClientCertificateCommonName' - } - } + name: 'String' + } + }, + clusterEndpoint: { + required: false, + readOnly: true, + serializedName: 'properties.clusterEndpoint', + type: { + name: 'String' + } + }, + clusterId: { + required: false, + readOnly: true, + serializedName: 'properties.clusterId', + type: { + name: 'String' + } + }, + clusterState: { + required: false, + readOnly: true, + serializedName: 'properties.clusterState', + type: { + name: 'String' + } + }, + diagnosticsStorageAccountConfig: { + required: false, + serializedName: 'properties.diagnosticsStorageAccountConfig', + type: { + name: 'Composite', + className: 'DiagnosticsStorageAccountConfig' } }, fabricSettings: { @@ -347,14 +470,6 @@ class Cluster extends models['Resource'] { } } }, - reverseProxyCertificate: { - required: false, - serializedName: 'properties.reverseProxyCertificate', - type: { - name: 'Composite', - className: 'CertificateDescription' - } - }, managementEndpoint: { required: true, serializedName: 'properties.managementEndpoint', @@ -377,14 +492,6 @@ class Cluster extends models['Resource'] { } } }, - azureActiveDirectory: { - required: false, - serializedName: 'properties.azureActiveDirectory', - type: { - name: 'Composite', - className: 'AzureActiveDirectory' - } - }, provisioningState: { required: false, readOnly: true, @@ -393,19 +500,27 @@ class Cluster extends models['Resource'] { name: 'String' } }, - vmImage: { + reliabilityLevel: { required: false, - serializedName: 'properties.vmImage', + serializedName: 'properties.reliabilityLevel', type: { name: 'String' } }, - diagnosticsStorageAccountConfig: { + reverseProxyCertificate: { required: false, - serializedName: 'properties.diagnosticsStorageAccountConfig', + serializedName: 'properties.reverseProxyCertificate', type: { name: 'Composite', - className: 'DiagnosticsStorageAccountConfig' + className: 'CertificateDescription' + } + }, + reverseProxyCertificateCommonNames: { + required: false, + serializedName: 'properties.reverseProxyCertificateCommonNames', + type: { + name: 'Composite', + className: 'ServerCertificateCommonNames' } }, upgradeDescription: { @@ -416,18 +531,18 @@ class Cluster extends models['Resource'] { className: 'ClusterUpgradePolicy' } }, - addOnFeatures: { + upgradeMode: { required: false, - serializedName: 'properties.addOnFeatures', + serializedName: 'properties.upgradeMode', type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } + name: 'String' + } + }, + vmImage: { + required: false, + serializedName: 'properties.vmImage', + type: { + name: 'String' } } } diff --git a/lib/services/serviceFabricManagement/lib/models/clusterHealthPolicy.js b/lib/services/serviceFabricManagement/lib/models/clusterHealthPolicy.js index 6ec6fe1f55..6b894a67a4 100644 --- a/lib/services/serviceFabricManagement/lib/models/clusterHealthPolicy.js +++ b/lib/services/serviceFabricManagement/lib/models/clusterHealthPolicy.js @@ -10,10 +10,13 @@ 'use strict'; +const models = require('./index'); + /** * Defines a health policy used to evaluate the health of the cluster or of a * cluster node. * + * */ class ClusterHealthPolicy { /** @@ -21,10 +24,38 @@ class ClusterHealthPolicy { * @member {number} [maxPercentUnhealthyNodes] The maximum allowed percentage * of unhealthy nodes before reporting an error. For example, to allow 10% of * nodes to be unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that + * can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, + * the health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes + * over the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of + * nodes. Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * . Default value: 0 . * @member {number} [maxPercentUnhealthyApplications] The maximum allowed * percentage of unhealthy applications before reporting an error. For * example, to allow 10% of applications to be unhealthy, this value would be * 10. + * + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over + * the total number of application instances in the cluster, excluding + * applications of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * . Default value: 0 . + * @member {object} [applicationHealthPolicies] Defines the application + * health policy map used to evaluate the health of an application or one of + * its children entities. */ constructor() { } @@ -46,6 +77,7 @@ class ClusterHealthPolicy { maxPercentUnhealthyNodes: { required: false, serializedName: 'maxPercentUnhealthyNodes', + defaultValue: 0, constraints: { InclusiveMaximum: 100, InclusiveMinimum: 0 @@ -57,6 +89,7 @@ class ClusterHealthPolicy { maxPercentUnhealthyApplications: { required: false, serializedName: 'maxPercentUnhealthyApplications', + defaultValue: 0, constraints: { InclusiveMaximum: 100, InclusiveMinimum: 0 @@ -64,6 +97,21 @@ class ClusterHealthPolicy { type: { name: 'Number' } + }, + applicationHealthPolicies: { + required: false, + serializedName: 'applicationHealthPolicies', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'ApplicationHealthPolicyElementType', + type: { + name: 'Composite', + className: 'ApplicationHealthPolicy' + } + } + } } } } diff --git a/lib/services/serviceFabricManagement/lib/models/clusterUpdateParameters.js b/lib/services/serviceFabricManagement/lib/models/clusterUpdateParameters.js index 8956ad512b..b07a678a1b 100644 --- a/lib/services/serviceFabricManagement/lib/models/clusterUpdateParameters.js +++ b/lib/services/serviceFabricManagement/lib/models/clusterUpdateParameters.js @@ -19,20 +19,8 @@ const models = require('./index'); class ClusterUpdateParameters { /** * Create a ClusterUpdateParameters. - * @member {string} [reliabilityLevel] The reliability level sets the replica - * set size of system services. Learn about - * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). - * Possible values include: 'Bronze', 'Silver', 'Gold' - * @member {string} [upgradeMode] The upgrade mode of the cluster. This - * indicates if the cluster should be automatically upgraded when new Service - * Fabric runtime version is available. Possible values include: 'Automatic', - * 'Manual' - * @member {string} [clusterCodeVersion] The Service Fabric runtime version - * of the cluster. This property can only by set the user when - * **upgradeMode** is set to 'Manual'. To get list of available Service - * Fabric versions for new clusters use [ClusterVersion - * API](./ClusterVersion.md). To get the list of available version for - * existing clusters use **availableClusterVersions**. + * @member {array} [addOnFeatures] The list of add-on features to enable in + * the cluster. * @member {object} [certificate] The certificate to use for securing the * cluster. The certificate provided will be used for node to node security * within the cluster, SSL certificate for cluster management endpoint and @@ -45,14 +33,44 @@ class ClusterUpdateParameters { * location. Possible values include: 'AddressBook', 'AuthRoot', * 'CertificateAuthority', 'Disallowed', 'My', 'Root', 'TrustedPeople', * 'TrustedPublisher' - * @member {array} [clientCertificateThumbprints] The list of client - * certificates referenced by thumbprint that are allowed to manage the - * cluster. This will overwrite the existing list. + * @member {object} [certificateCommonNames] Describes a list of server + * certificates referenced by common name that are used to secure the + * cluster. + * @member {array} [certificateCommonNames.commonNames] The list of server + * certificates referenced by common name that are used to secure the + * cluster. + * @member {string} [certificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * @member {array} [clientCertificateCommonNames] The list of client * certificates referenced by common name that are allowed to manage the * cluster. This will overwrite the existing list. + * @member {array} [clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. This will overwrite the existing list. + * @member {string} [clusterCodeVersion] The Service Fabric runtime version + * of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service + * Fabric versions for new clusters use [ClusterVersion + * API](./ClusterVersion.md). To get the list of available version for + * existing clusters use **availableClusterVersions**. * @member {array} [fabricSettings] The list of custom fabric settings to * configure the cluster. This will overwrite the existing list. + * @member {array} [nodeTypes] The list of node types in the cluster. This + * will overwrite the existing list. + * @member {string} [reliabilityLevel] The reliability level sets the replica + * set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + * + * - None - Run the System services with a target replica set count of 1. + * This should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' * @member {object} [reverseProxyCertificate] The server certificate used by * reverse proxy. * @member {string} [reverseProxyCertificate.thumbprint] Thumbprint of the @@ -63,8 +81,6 @@ class ClusterUpdateParameters { * certificate store location. Possible values include: 'AddressBook', * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', * 'TrustedPeople', 'TrustedPublisher' - * @member {array} [nodeTypes] The list of node types in the cluster. This - * will overwrite the existing list. * @member {object} [upgradeDescription] The policy to use when upgrading the * cluster. * @member {boolean} [upgradeDescription.forceRestart] If true, then @@ -101,41 +117,82 @@ class ClusterUpdateParameters { * [upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The maximum * allowed percentage of unhealthy nodes before reporting an error. For * example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that + * can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, + * the health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes + * over the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of + * nodes. Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. * @member {number} * [upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] The * maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this * value would be 10. - * @member {object} [upgradeDescription.deltaHealthPolicy] The delta health - * policy used when upgrading the cluster. + * + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over + * the total number of application instances in the cluster, excluding + * applications of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * @member {object} + * [upgradeDescription.healthPolicy.applicationHealthPolicies] Defines the + * application health policy map used to evaluate the health of an + * application or one of its children entities. + * @member {object} [upgradeDescription.deltaHealthPolicy] The cluster delta + * health policy used when upgrading the cluster. * @member {number} * [upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes] The * maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain - * upgrade completion to make sure the global state of the cluster is within - * tolerated limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to + * make sure the global state of the cluster is within tolerated limits. * @member {number} * [upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes] * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state - * of the upgrade domain nodes at the beginning of upgrade and the state of - * the upgrade domain nodes at the time of the health evaluation. The check - * is performed after every upgrade domain upgrade completion for all - * completed upgrade domains to make sure the state of the upgrade domains is - * within tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for + * all completed upgrade domains to make sure the state of the upgrade + * domains is within tolerated limits. * @member {number} * [upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications] * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. - * @member {array} [addOnFeatures] The list of add-on features to enable in - * the cluster. + * during cluster upgrades. + * The delta is measured between the state of the applications at the + * beginning of upgrade and the state of the applications at the time of the + * health evaluation. + * The check is performed after every upgrade domain upgrade completion to + * make sure the global state of the cluster is within tolerated limits. + * System services are not included in this. + * @member {object} + * [upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the + * health of an application or one of its child entities when upgrading the + * cluster. + * @member {string} [upgradeMode] The upgrade mode of the cluster when new + * Service Fabric runtime version is available. + * + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' * @member {object} [tags] Cluster update parameters */ constructor() { @@ -155,65 +212,73 @@ class ClusterUpdateParameters { name: 'Composite', className: 'ClusterUpdateParameters', modelProperties: { - reliabilityLevel: { - required: false, - serializedName: 'properties.reliabilityLevel', - type: { - name: 'String' - } - }, - upgradeMode: { + addOnFeatures: { required: false, - serializedName: 'properties.upgradeMode', + serializedName: 'properties.addOnFeatures', type: { - name: 'String' + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } } }, - clusterCodeVersion: { + certificate: { required: false, - serializedName: 'properties.clusterCodeVersion', + serializedName: 'properties.certificate', type: { - name: 'String' + name: 'Composite', + className: 'CertificateDescription' } }, - certificate: { + certificateCommonNames: { required: false, - serializedName: 'properties.certificate', + serializedName: 'properties.certificateCommonNames', type: { name: 'Composite', - className: 'CertificateDescription' + className: 'ServerCertificateCommonNames' } }, - clientCertificateThumbprints: { + clientCertificateCommonNames: { required: false, - serializedName: 'properties.clientCertificateThumbprints', + serializedName: 'properties.clientCertificateCommonNames', type: { name: 'Sequence', element: { required: false, - serializedName: 'ClientCertificateThumbprintElementType', + serializedName: 'ClientCertificateCommonNameElementType', type: { name: 'Composite', - className: 'ClientCertificateThumbprint' + className: 'ClientCertificateCommonName' } } } }, - clientCertificateCommonNames: { + clientCertificateThumbprints: { required: false, - serializedName: 'properties.clientCertificateCommonNames', + serializedName: 'properties.clientCertificateThumbprints', type: { name: 'Sequence', element: { required: false, - serializedName: 'ClientCertificateCommonNameElementType', + serializedName: 'ClientCertificateThumbprintElementType', type: { name: 'Composite', - className: 'ClientCertificateCommonName' + className: 'ClientCertificateThumbprint' } } } }, + clusterCodeVersion: { + required: false, + serializedName: 'properties.clusterCodeVersion', + type: { + name: 'String' + } + }, fabricSettings: { required: false, serializedName: 'properties.fabricSettings', @@ -229,14 +294,6 @@ class ClusterUpdateParameters { } } }, - reverseProxyCertificate: { - required: false, - serializedName: 'properties.reverseProxyCertificate', - type: { - name: 'Composite', - className: 'CertificateDescription' - } - }, nodeTypes: { required: false, serializedName: 'properties.nodeTypes', @@ -252,6 +309,21 @@ class ClusterUpdateParameters { } } }, + reliabilityLevel: { + required: false, + serializedName: 'properties.reliabilityLevel', + type: { + name: 'String' + } + }, + reverseProxyCertificate: { + required: false, + serializedName: 'properties.reverseProxyCertificate', + type: { + name: 'Composite', + className: 'CertificateDescription' + } + }, upgradeDescription: { required: false, serializedName: 'properties.upgradeDescription', @@ -260,18 +332,11 @@ class ClusterUpdateParameters { className: 'ClusterUpgradePolicy' } }, - addOnFeatures: { + upgradeMode: { required: false, - serializedName: 'properties.addOnFeatures', + serializedName: 'properties.upgradeMode', type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } + name: 'String' } }, tags: { diff --git a/lib/services/serviceFabricManagement/lib/models/clusterUpgradeDeltaHealthPolicy.js b/lib/services/serviceFabricManagement/lib/models/clusterUpgradeDeltaHealthPolicy.js index 2c11703010..327dc67e24 100644 --- a/lib/services/serviceFabricManagement/lib/models/clusterUpgradeDeltaHealthPolicy.js +++ b/lib/services/serviceFabricManagement/lib/models/clusterUpgradeDeltaHealthPolicy.js @@ -10,6 +10,8 @@ 'use strict'; +const models = require('./index'); + /** * Describes the delta health policies for the cluster upgrade. * @@ -25,19 +27,25 @@ class ClusterUpgradeDeltaHealthPolicy { * make sure the global state of the cluster is within tolerated limits. * @member {number} maxPercentUpgradeDomainDeltaUnhealthyNodes The maximum * allowed percentage of upgrade domain nodes health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for + * all completed upgrade domains to make sure the state of the upgrade + * domains is within tolerated limits. * @member {number} maxPercentDeltaUnhealthyApplications The maximum allowed * percentage of applications health degradation allowed during cluster - * upgrades. The delta is measured between the state of the applications at - * the beginning of upgrade and the state of the applications at the time of - * the health evaluation. The check is performed after every upgrade domain - * upgrade completion to make sure the global state of the cluster is within - * tolerated limits. System services are not included in this. + * upgrades. + * The delta is measured between the state of the applications at the + * beginning of upgrade and the state of the applications at the time of the + * health evaluation. + * The check is performed after every upgrade domain upgrade completion to + * make sure the global state of the cluster is within tolerated limits. + * System services are not included in this. + * @member {object} [applicationDeltaHealthPolicies] Defines the application + * delta health policy map used to evaluate the health of an application or + * one of its child entities when upgrading the cluster. */ constructor() { } @@ -88,6 +96,21 @@ class ClusterUpgradeDeltaHealthPolicy { type: { name: 'Number' } + }, + applicationDeltaHealthPolicies: { + required: false, + serializedName: 'applicationDeltaHealthPolicies', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'ApplicationDeltaHealthPolicyElementType', + type: { + name: 'Composite', + className: 'ApplicationDeltaHealthPolicy' + } + } + } } } } diff --git a/lib/services/serviceFabricManagement/lib/models/clusterUpgradePolicy.js b/lib/services/serviceFabricManagement/lib/models/clusterUpgradePolicy.js index 9d37c59e41..086a390485 100644 --- a/lib/services/serviceFabricManagement/lib/models/clusterUpgradePolicy.js +++ b/lib/services/serviceFabricManagement/lib/models/clusterUpgradePolicy.js @@ -50,36 +50,68 @@ class ClusterUpgradePolicy { * @member {number} [healthPolicy.maxPercentUnhealthyNodes] The maximum * allowed percentage of unhealthy nodes before reporting an error. For * example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that + * can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, + * the health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes + * over the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of + * nodes. Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. * @member {number} [healthPolicy.maxPercentUnhealthyApplications] The * maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this * value would be 10. - * @member {object} [deltaHealthPolicy] The delta health policy used when - * upgrading the cluster. + * + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over + * the total number of application instances in the cluster, excluding + * applications of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * @member {object} [healthPolicy.applicationHealthPolicies] Defines the + * application health policy map used to evaluate the health of an + * application or one of its children entities. + * @member {object} [deltaHealthPolicy] The cluster delta health policy used + * when upgrading the cluster. * @member {number} [deltaHealthPolicy.maxPercentDeltaUnhealthyNodes] The * maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain - * upgrade completion to make sure the global state of the cluster is within - * tolerated limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to + * make sure the global state of the cluster is within tolerated limits. * @member {number} * [deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes] The maximum * allowed percentage of upgrade domain nodes health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for + * all completed upgrade domains to make sure the state of the upgrade + * domains is within tolerated limits. * @member {number} [deltaHealthPolicy.maxPercentDeltaUnhealthyApplications] * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * during cluster upgrades. + * The delta is measured between the state of the applications at the + * beginning of upgrade and the state of the applications at the time of the + * health evaluation. + * The check is performed after every upgrade domain upgrade completion to + * make sure the global state of the cluster is within tolerated limits. + * System services are not included in this. + * @member {object} [deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the + * health of an application or one of its child entities when upgrading the + * cluster. */ constructor() { } diff --git a/lib/services/serviceFabricManagement/lib/models/errorModel.js b/lib/services/serviceFabricManagement/lib/models/errorModel.js index edfcafabc8..7888e70ce8 100644 --- a/lib/services/serviceFabricManagement/lib/models/errorModel.js +++ b/lib/services/serviceFabricManagement/lib/models/errorModel.js @@ -10,15 +10,18 @@ 'use strict'; +const models = require('./index'); + /** - * The error details. + * The structure of the error. * */ class ErrorModel { /** * Create a ErrorModel. - * @member {string} [code] The error code. - * @member {string} [message] The error message. + * @member {object} [error] The error details. + * @member {string} [error.code] The error code. + * @member {string} [error.message] The error message. */ constructor() { } @@ -37,18 +40,12 @@ class ErrorModel { name: 'Composite', className: 'ErrorModel', modelProperties: { - code: { - required: false, - serializedName: 'code', - type: { - name: 'String' - } - }, - message: { + error: { required: false, - serializedName: 'message', + serializedName: 'error', type: { - name: 'String' + name: 'Composite', + className: 'ErrorModelError' } } } diff --git a/lib/services/serviceFabricManagement/lib/models/errorModelError.js b/lib/services/serviceFabricManagement/lib/models/errorModelError.js new file mode 100644 index 0000000000..084c5f7e89 --- /dev/null +++ b/lib/services/serviceFabricManagement/lib/models/errorModelError.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * The error details. + * + */ +class ErrorModelError { + /** + * Create a ErrorModelError. + * @member {string} [code] The error code. + * @member {string} [message] The error message. + */ + constructor() { + } + + /** + * Defines the metadata of ErrorModelError + * + * @returns {object} metadata of ErrorModelError + * + */ + mapper() { + return { + required: false, + serializedName: 'ErrorModelError', + type: { + name: 'Composite', + className: 'ErrorModelError', + modelProperties: { + code: { + required: false, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ErrorModelError; diff --git a/lib/services/serviceFabricManagement/lib/models/index.d.ts b/lib/services/serviceFabricManagement/lib/models/index.d.ts index 7bbfab6870..308a5e9b26 100644 --- a/lib/services/serviceFabricManagement/lib/models/index.d.ts +++ b/lib/services/serviceFabricManagement/lib/models/index.d.ts @@ -18,110 +18,66 @@ export { CloudError } from 'ms-rest-azure'; /** * @class - * Initializes a new instance of the ServiceTypeHealthPolicy class. + * Initializes a new instance of the ServiceTypeDeltaHealthPolicy class. * @constructor - * Represents the health policy used to evaluate the health of services - * belonging to a service type. + * Represents the delta health policy used to evaluate the health of services + * belonging to a service type when upgrading the cluster. * * - * @member {number} [maxPercentUnhealthyPartitionsPerService] The maximum - * allowed percentage of unhealthy partitions per service. Allowed values are - * Byte values from zero to 100 - * - * The percentage represents the maximum tolerated percentage of partitions - * that can be unhealthy before the service is considered in error. - * If the percentage is respected but there is at least one unhealthy - * partition, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy partitions - * over the total number of partitions in the service. - * The computation rounds up to tolerate one failure on small numbers of - * partitions. Default percentage is zero. - * . Default value: 0 . - * @member {number} [maxPercentUnhealthyReplicasPerPartition] The maximum - * allowed percentage of unhealthy replicas per partition. Allowed values are - * Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of replicas that - * can be unhealthy before the partition is considered in error. - * If the percentage is respected but there is at least one unhealthy replica, - * the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy replicas - * over the total number of replicas in the partition. - * The computation rounds up to tolerate one failure on small numbers of - * replicas. Default percentage is zero. - * . Default value: 0 . - * @member {number} [maxPercentUnhealthyServices] The maximum maximum allowed - * percentage of unhealthy services. Allowed values are Byte values from zero - * to 100. - * - * The percentage represents the maximum tolerated percentage of services that - * can be unhealthy before the application is considered in error. - * If the percentage is respected but there is at least one unhealthy service, - * the health is evaluated as Warning. - * This is calculated by dividing the number of unhealthy services of the - * specific service type over the total number of services of the specific - * service type. - * The computation rounds up to tolerate one failure on small numbers of - * services. Default percentage is zero. + * @member {number} [maxPercentDeltaUnhealthyServices] The maximum allowed + * percentage of services health degradation allowed during cluster upgrades. + * The delta is measured between the state of the services at the beginning of + * upgrade and the state of the services at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. * . Default value: 0 . */ -export interface ServiceTypeHealthPolicy { - maxPercentUnhealthyPartitionsPerService?: number; - maxPercentUnhealthyReplicasPerPartition?: number; - maxPercentUnhealthyServices?: number; +export interface ServiceTypeDeltaHealthPolicy { + maxPercentDeltaUnhealthyServices?: number; } /** * @class - * Initializes a new instance of the ServiceTypeHealthPolicyMapItem class. + * Initializes a new instance of the ApplicationDeltaHealthPolicy class. * @constructor - * Defines an item in ServiceTypeHealthPolicyMap. + * Defines a delta health policy used to evaluate the health of an application + * or one of its child entities when upgrading the cluster. * * - * @member {string} key The key of the service type health policy map item. - * This is the name of the service type. - * @member {object} value - * @member {number} [value.maxPercentUnhealthyPartitionsPerService] The maximum - * allowed percentage of unhealthy partitions per service. Allowed values are - * Byte values from zero to 100 + * @member {object} [defaultServiceTypeDeltaHealthPolicy] The delta health + * policy used by default to evaluate the health of a service type when + * upgrading the cluster. + * @member {number} + * [defaultServiceTypeDeltaHealthPolicy.maxPercentDeltaUnhealthyServices] The + * maximum allowed percentage of services health degradation allowed during + * cluster upgrades. + * The delta is measured between the state of the services at the beginning of + * upgrade and the state of the services at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * @member {object} [serviceTypeDeltaHealthPolicies] The map with service type + * delta health policy per service type name. The map is empty by default. + */ +export interface ApplicationDeltaHealthPolicy { + defaultServiceTypeDeltaHealthPolicy?: ServiceTypeDeltaHealthPolicy; + serviceTypeDeltaHealthPolicies?: { [propertyName: string]: ServiceTypeDeltaHealthPolicy }; +} + +/** + * @class + * Initializes a new instance of the ServiceTypeHealthPolicy class. + * @constructor + * Represents the health policy used to evaluate the health of services + * belonging to a service type. * - * The percentage represents the maximum tolerated percentage of partitions - * that can be unhealthy before the service is considered in error. - * If the percentage is respected but there is at least one unhealthy - * partition, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy partitions - * over the total number of partitions in the service. - * The computation rounds up to tolerate one failure on small numbers of - * partitions. Default percentage is zero. - * @member {number} [value.maxPercentUnhealthyReplicasPerPartition] The maximum - * allowed percentage of unhealthy replicas per partition. Allowed values are - * Byte values from zero to 100. * - * The percentage represents the maximum tolerated percentage of replicas that - * can be unhealthy before the partition is considered in error. - * If the percentage is respected but there is at least one unhealthy replica, - * the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy replicas - * over the total number of replicas in the partition. - * The computation rounds up to tolerate one failure on small numbers of - * replicas. Default percentage is zero. - * @member {number} [value.maxPercentUnhealthyServices] The maximum maximum - * allowed percentage of unhealthy services. Allowed values are Byte values - * from zero to 100. - * - * The percentage represents the maximum tolerated percentage of services that - * can be unhealthy before the application is considered in error. - * If the percentage is respected but there is at least one unhealthy service, - * the health is evaluated as Warning. - * This is calculated by dividing the number of unhealthy services of the - * specific service type over the total number of services of the specific - * service type. - * The computation rounds up to tolerate one failure on small numbers of - * services. Default percentage is zero. + * @member {number} [maxPercentUnhealthyServices] The maximum percentage of + * services allowed to be unhealthy before your application is considered in + * error. + * . Default value: 0 . */ -export interface ServiceTypeHealthPolicyMapItem { - key: string; - value: ServiceTypeHealthPolicy; +export interface ServiceTypeHealthPolicy { + maxPercentUnhealthyServices?: number; } /** @@ -132,6 +88,14 @@ export interface ServiceTypeHealthPolicyMapItem { * of its children entities. * * + * @member {object} [defaultServiceTypeHealthPolicy] The health policy used by + * default to evaluate the health of a service type. + * @member {number} + * [defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] The maximum + * percentage of services allowed to be unhealthy before your application is + * considered in error. + * @member {object} [serviceTypeHealthPolicies] The map with service type + * health policy per service type name. The map is empty by default. * @member {boolean} [considerWarningAsError] Indicates whether warnings are * treated with the same severity as errors. Default value: false . * @member {number} [maxPercentUnhealthyDeployedApplications] The maximum @@ -146,1656 +110,1932 @@ export interface ServiceTypeHealthPolicyMapItem { * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. * . Default value: 0 . - * @member {object} [defaultServiceTypeHealthPolicy] - * @member {number} - * [defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] The - * maximum allowed percentage of unhealthy partitions per service. Allowed - * values are Byte values from zero to 100 - * - * The percentage represents the maximum tolerated percentage of partitions - * that can be unhealthy before the service is considered in error. - * If the percentage is respected but there is at least one unhealthy - * partition, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy partitions - * over the total number of partitions in the service. - * The computation rounds up to tolerate one failure on small numbers of - * partitions. Default percentage is zero. - * @member {number} - * [defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] The - * maximum allowed percentage of unhealthy replicas per partition. Allowed - * values are Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of replicas that - * can be unhealthy before the partition is considered in error. - * If the percentage is respected but there is at least one unhealthy replica, - * the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy replicas - * over the total number of replicas in the partition. - * The computation rounds up to tolerate one failure on small numbers of - * replicas. Default percentage is zero. + * @member {object} [defaultServiceTypeHealthPolicy1] The health policy used by + * default to evaluate the health of a service type. * @member {number} - * [defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] The maximum - * maximum allowed percentage of unhealthy services. Allowed values are Byte - * values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of services that - * can be unhealthy before the application is considered in error. - * If the percentage is respected but there is at least one unhealthy service, - * the health is evaluated as Warning. - * This is calculated by dividing the number of unhealthy services of the - * specific service type over the total number of services of the specific - * service type. - * The computation rounds up to tolerate one failure on small numbers of - * services. Default percentage is zero. - * @member {array} [serviceTypeHealthPolicyMap] + * [defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] The maximum + * percentage of services allowed to be unhealthy before your application is + * considered in error. + * @member {object} [serviceTypeHealthPolicyMap] The map with service type + * health policy per service type name. The map is empty by default. */ export interface ApplicationHealthPolicy { + defaultServiceTypeHealthPolicy?: ServiceTypeHealthPolicy; + serviceTypeHealthPolicies?: { [propertyName: string]: ServiceTypeHealthPolicy }; considerWarningAsError?: boolean; maxPercentUnhealthyDeployedApplications?: number; - defaultServiceTypeHealthPolicy?: ServiceTypeHealthPolicy; - serviceTypeHealthPolicyMap?: ServiceTypeHealthPolicyMapItem[]; + defaultServiceTypeHealthPolicy1?: ServiceTypeHealthPolicy; + serviceTypeHealthPolicyMap?: { [propertyName: string]: ServiceTypeHealthPolicy }; } /** * @class - * Initializes a new instance of the ApplicationMetricDescription class. + * Initializes a new instance of the AvailableOperationDisplay class. * @constructor - * Describes capacity information for a custom resource balancing metric. This - * can be used to limit the total consumption of this metric by the services of - * this application. - * + * Operation supported by Service Fabric resource provider * - * @member {string} [name] The name of the metric. - * @member {number} [maximumCapacity] The maximum node capacity for Service - * Fabric application. - * This is the maximum Load for an instance of this application on a single - * node. Even if the capacity of node is greater than this value, Service - * Fabric will limit the total load of services within the application on each - * node to this value. - * If set to zero, capacity for this metric is unlimited on each node. - * When creating a new application with application capacity defined, the - * product of MaximumNodes and this value must always be smaller than or equal - * to TotalApplicationCapacity. - * When updating existing application with application capacity, the product of - * MaximumNodes and this value must always be smaller than or equal to - * TotalApplicationCapacity. - * @member {number} [reservationCapacity] The node reservation capacity for - * Service Fabric application. - * This is the amount of load which is reserved on nodes which have instances - * of this application. - * If MinimumNodes is specified, then the product of these values will be the - * capacity reserved in the cluster for the application. - * If set to zero, no capacity is reserved for this metric. - * When setting application capacity or when updating application capacity; - * this value must be smaller than or equal to MaximumCapacity for each metric. - * @member {number} [totalApplicationCapacity] The total metric capacity for - * Service Fabric application. - * This is the total metric capacity for this application in the cluster. - * Service Fabric will try to limit the sum of loads of services within the - * application to this value. - * When creating a new application with application capacity defined, the - * product of MaximumNodes and MaximumCapacity must always be smaller than or - * equal to this value. + * @member {string} [provider] The name of the provider. + * @member {string} [resource] The resource on which the operation is performed + * @member {string} [operation] The operation that can be performed. + * @member {string} [description] Operation description */ -export interface ApplicationMetricDescription { - name?: string; - maximumCapacity?: number; - reservationCapacity?: number; - totalApplicationCapacity?: number; +export interface AvailableOperationDisplay { + provider?: string; + resource?: string; + operation?: string; + description?: string; } /** * @class - * Initializes a new instance of the ApplicationParameter class. + * Initializes a new instance of the AzureActiveDirectory class. * @constructor - * Describes an application parameter override to be applied when creating or - * upgrading an application. + * The settings to enable AAD authentication on the cluster. * - * @member {string} key The name of the parameter. - * @member {string} value The value of the parameter. + * @member {string} [tenantId] Azure active directory tenant id. + * @member {string} [clusterApplication] Azure active directory cluster + * application id. + * @member {string} [clientApplication] Azure active directory client + * application id. */ -export interface ApplicationParameter { - key: string; - value: string; +export interface AzureActiveDirectory { + tenantId?: string; + clusterApplication?: string; + clientApplication?: string; } /** * @class - * Initializes a new instance of the ServiceCorrelationDescription class. + * Initializes a new instance of the CertificateDescription class. * @constructor - * Creates a particular correlation between services. + * Describes the certificate details. * - * @member {string} scheme Possible values include: 'Invalid', 'Affinity', - * 'AlignedAffinity', 'NonAlignedAffinity' - * @member {string} serviceName + * @member {string} thumbprint Thumbprint of the primary certificate. + * @member {string} [thumbprintSecondary] Thumbprint of the secondary + * certificate. + * @member {string} [x509StoreName] The local certificate store location. + * Possible values include: 'AddressBook', 'AuthRoot', 'CertificateAuthority', + * 'Disallowed', 'My', 'Root', 'TrustedPeople', 'TrustedPublisher' */ -export interface ServiceCorrelationDescription { - scheme: string; - serviceName: string; +export interface CertificateDescription { + thumbprint: string; + thumbprintSecondary?: string; + x509StoreName?: string; } /** * @class - * Initializes a new instance of the ServiceLoadMetricDescription class. + * Initializes a new instance of the ClientCertificateCommonName class. * @constructor - * Specifies a metric to load balance a service during runtime. + * Describes the client certificate details using common name. * - * @member {string} name The name of the metric. If the service chooses to - * report load during runtime, the load metric name should match the name that - * is specified in Name exactly. Note that metric names are case sensitive. - * @member {string} [weight] Possible values include: 'Zero', 'Low', 'Medium', - * 'High' - * @member {number} [primaryDefaultLoad] Used only for Stateful services. The - * default amount of load, as a number, that this service creates for this - * metric when it is a Primary replica. - * @member {number} [secondaryDefaultLoad] Used only for Stateful services. The - * default amount of load, as a number, that this service creates for this - * metric when it is a Secondary replica. - * @member {number} [defaultLoad] Used only for Stateless services. The default - * amount of load, as a number, that this service creates for this metric. + * @member {boolean} isAdmin Indicates if the client certificate has admin + * access to the cluster. Non admin clients can perform only read only + * operations on the cluster. + * @member {string} certificateCommonName The common name of the client + * certificate. + * @member {string} certificateIssuerThumbprint The issuer thumbprint of the + * client certificate. */ -export interface ServiceLoadMetricDescription { - name: string; - weight?: string; - primaryDefaultLoad?: number; - secondaryDefaultLoad?: number; - defaultLoad?: number; +export interface ClientCertificateCommonName { + isAdmin: boolean; + certificateCommonName: string; + certificateIssuerThumbprint: string; } /** * @class - * Initializes a new instance of the ServicePlacementPolicyDescription class. + * Initializes a new instance of the ClientCertificateThumbprint class. * @constructor - * Describes the policy to be used for placement of a Service Fabric service. + * Describes the client certificate details using thumbprint. * - * @member {string} type Polymorphic Discriminator + * @member {boolean} isAdmin Indicates if the client certificate has admin + * access to the cluster. Non admin clients can perform only read only + * operations on the cluster. + * @member {string} certificateThumbprint The thumbprint of the client + * certificate. */ -export interface ServicePlacementPolicyDescription { - type: string; +export interface ClientCertificateThumbprint { + isAdmin: boolean; + certificateThumbprint: string; } /** * @class - * Initializes a new instance of the PartitionSchemeDescription class. + * Initializes a new instance of the ClusterVersionDetails class. * @constructor - * Describes how the service is partitioned. + * The detail of the Service Fabric runtime version result * - * @member {string} partitionScheme Polymorphic Discriminator + * @member {string} [codeVersion] The Service Fabric runtime version of the + * cluster. + * @member {string} [supportExpiryUtc] The date of expiry of support of the + * version. + * @member {string} [environment] Indicates if this version is for Windows or + * Linux operating system. Possible values include: 'Windows', 'Linux' */ -export interface PartitionSchemeDescription { - partitionScheme: string; +export interface ClusterVersionDetails { + codeVersion?: string; + supportExpiryUtc?: string; + environment?: string; } /** * @class - * Initializes a new instance of the NamedPartitionSchemeDescription class. + * Initializes a new instance of the ServerCertificateCommonName class. * @constructor - * Describes the named partition scheme of the service. + * Describes the server certificate details using common name. * - * @member {number} count The number of partitions. - * @member {array} names Array of size specified by the ‘Count’ parameter, for - * the names of the partitions. + * @member {string} certificateCommonName The common name of the server + * certificate. + * @member {string} certificateIssuerThumbprint The issuer thumbprint of the + * server certificate. */ -export interface NamedPartitionSchemeDescription extends PartitionSchemeDescription { - count: number; - names: string[]; +export interface ServerCertificateCommonName { + certificateCommonName: string; + certificateIssuerThumbprint: string; } /** * @class - * Initializes a new instance of the SingletonPartitionSchemeDescription class. + * Initializes a new instance of the ServerCertificateCommonNames class. * @constructor - * Describes the partition scheme of a singleton-partitioned, or - * non-partitioned service. + * Describes a list of server certificates referenced by common name that are + * used to secure the cluster. * + * @member {array} [commonNames] The list of server certificates referenced by + * common name that are used to secure the cluster. + * @member {string} [x509StoreName] The local certificate store location. + * Possible values include: 'AddressBook', 'AuthRoot', 'CertificateAuthority', + * 'Disallowed', 'My', 'Root', 'TrustedPeople', 'TrustedPublisher' */ -export interface SingletonPartitionSchemeDescription extends PartitionSchemeDescription { +export interface ServerCertificateCommonNames { + commonNames?: ServerCertificateCommonName[]; + x509StoreName?: string; } /** * @class - * Initializes a new instance of the UniformInt64RangePartitionSchemeDescription class. + * Initializes a new instance of the DiagnosticsStorageAccountConfig class. * @constructor - * Describes a partitioning scheme where an integer range is allocated evenly - * across a number of partitions. + * The storage account information for storing Service Fabric diagnostic logs. * - * @member {number} count The number of partitions. - * @member {string} lowKey String indicating the lower bound of the partition - * key range that - * should be split between the partition ‘Count’ - * @member {string} highKey String indicating the upper bound of the partition - * key range that - * should be split between the partition ‘Count’ + * @member {string} storageAccountName The Azure storage account name. + * @member {string} protectedAccountKeyName The protected diagnostics storage + * key name. + * @member {string} blobEndpoint The blob endpoint of the azure storage + * account. + * @member {string} queueEndpoint The queue endpoint of the azure storage + * account. + * @member {string} tableEndpoint The table endpoint of the azure storage + * account. */ -export interface UniformInt64RangePartitionSchemeDescription extends PartitionSchemeDescription { - count: number; - lowKey: string; - highKey: string; +export interface DiagnosticsStorageAccountConfig { + storageAccountName: string; + protectedAccountKeyName: string; + blobEndpoint: string; + queueEndpoint: string; + tableEndpoint: string; } /** * @class - * Initializes a new instance of the ProxyResource class. + * Initializes a new instance of the SettingsParameterDescription class. * @constructor - * The resource model definition. + * Describes a parameter in fabric settings of the cluster. * - * @member {string} [id] Azure resource ID. - * @member {string} [name] Azure resource name. - * @member {string} [type] Azure resource type. - * @member {string} location Resource location. + * @member {string} name The parameter name of fabric setting. + * @member {string} value The parameter value of fabric setting. */ -export interface ProxyResource extends BaseResource { - readonly id?: string; - readonly name?: string; - readonly type?: string; - location: string; +export interface SettingsParameterDescription { + name: string; + value: string; } /** * @class - * Initializes a new instance of the ApplicationTypeResource class. + * Initializes a new instance of the SettingsSectionDescription class. * @constructor - * The application type name resource + * Describes a section in the fabric settings of the cluster. * - * @member {string} [provisioningState] The current deployment or provisioning - * state, which only appears in the response. + * @member {string} name The section name of the fabric settings. + * @member {array} parameters The collection of parameters in the section. */ -export interface ApplicationTypeResource extends ProxyResource { - readonly provisioningState?: string; +export interface SettingsSectionDescription { + name: string; + parameters: SettingsParameterDescription[]; } /** * @class - * Initializes a new instance of the ApplicationTypeResourceList class. + * Initializes a new instance of the EndpointRangeDescription class. * @constructor - * The list of application type names. + * Port range details * - * @member {array} [value] + * @member {number} startPort Starting port of a range of ports + * @member {number} endPort End port of a range of ports */ -export interface ApplicationTypeResourceList { - value?: ApplicationTypeResource[]; +export interface EndpointRangeDescription { + startPort: number; + endPort: number; } /** * @class - * Initializes a new instance of the VersionResource class. + * Initializes a new instance of the NodeTypeDescription class. * @constructor - * A version resource for the specified application type name. + * Describes a node type in the cluster, each node type represents sub set of + * nodes in the cluster. * - * @member {string} [provisioningState] The current deployment or provisioning - * state, which only appears in the response - * @member {string} [appPackageUrl] The URL to the application package - * @member {array} [defaultParameterList] + * @member {string} name The name of the node type. + * @member {object} [placementProperties] The placement tags applied to nodes + * in the node type, which can be used to indicate where certain services + * (workload) should run. + * @member {object} [capacities] The capacity tags applied to the nodes in the + * node type, the cluster resource manager uses these tags to understand how + * much resource a node has. + * @member {number} clientConnectionEndpointPort The TCP cluster management + * endpoint port. + * @member {number} httpGatewayEndpointPort The HTTP cluster management + * endpoint port. + * @member {string} [durabilityLevel] The durability level of the node type. + * Learn about + * [DurabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + * + * - Bronze - No privileges. This is the default. + * - Silver - The infrastructure jobs can be paused for a duration of 10 + * minutes per UD. + * - Gold - The infrastructure jobs can be paused for a duration of 2 hours per + * UD. Gold durability can be enabled only on full node VM skus like D15_V2, G5 + * etc. + * . Possible values include: 'Bronze', 'Silver', 'Gold' + * @member {object} [applicationPorts] The range of ports from which cluster + * assigned port to Service Fabric applications. + * @member {number} [applicationPorts.startPort] Starting port of a range of + * ports + * @member {number} [applicationPorts.endPort] End port of a range of ports + * @member {object} [ephemeralPorts] The range of empheral ports that nodes in + * this node type should be configured with. + * @member {number} [ephemeralPorts.startPort] Starting port of a range of + * ports + * @member {number} [ephemeralPorts.endPort] End port of a range of ports + * @member {boolean} isPrimary The node type on which system services will run. + * Only one node type should be marked as primary. Primary node type cannot be + * deleted or changed for existing clusters. + * @member {number} vmInstanceCount The number of nodes in the node type. This + * count should match the capacity property in the corresponding + * VirtualMachineScaleSet resource. + * @member {number} [reverseProxyEndpointPort] The endpoint used by reverse + * proxy. */ -export interface VersionResource extends ProxyResource { - readonly provisioningState?: string; - appPackageUrl?: string; - readonly defaultParameterList?: ApplicationParameter[]; +export interface NodeTypeDescription { + name: string; + placementProperties?: { [propertyName: string]: string }; + capacities?: { [propertyName: string]: string }; + clientConnectionEndpointPort: number; + httpGatewayEndpointPort: number; + durabilityLevel?: string; + applicationPorts?: EndpointRangeDescription; + ephemeralPorts?: EndpointRangeDescription; + isPrimary: boolean; + vmInstanceCount: number; + reverseProxyEndpointPort?: number; } /** * @class - * Initializes a new instance of the VersionResourceList class. + * Initializes a new instance of the ClusterHealthPolicy class. * @constructor - * The list of version resources for the specified application type name. + * Defines a health policy used to evaluate the health of the cluster or of a + * cluster node. * - * @member {array} [value] - */ -export interface VersionResourceList { - value?: VersionResource[]; -} - -/** - * @class - * Initializes a new instance of the ApplicationResource class. - * @constructor - * The application resource. * - * @member {string} [typeVersion] - * @member {array} [parameters] - * @member {object} [upgradePolicy] - * @member {number} [upgradePolicy.upgradeReplicaSetCheckTimeout] - * @member {boolean} [upgradePolicy.forceRestart] - * @member {object} [upgradePolicy.rollingUpgradeMonitoringPolicy] - * @member {string} - * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] - * @member {string} - * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] - * @member {string} - * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] - * @member {string} - * [upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] - * @member {string} - * [upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] - * @member {object} [upgradePolicy.applicationHealthPolicy] - * @member {boolean} - * [upgradePolicy.applicationHealthPolicy.considerWarningAsError] Indicates - * whether warnings are treated with the same severity as errors. - * @member {number} - * [upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] - * The maximum allowed percentage of unhealthy deployed applications. Allowed - * values are Byte values from zero to 100. - * The percentage represents the maximum tolerated percentage of deployed - * applications that can be unhealthy before the application is considered in - * error. - * This is calculated by dividing the number of unhealthy deployed applications - * over the number of nodes where the application is currently deployed on in - * the cluster. + * @member {number} [maxPercentUnhealthyNodes] The maximum allowed percentage + * of unhealthy nodes before reporting an error. For example, to allow 10% of + * nodes to be unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. - * @member {object} - * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * @member {number} - * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. Allowed - * values are Byte values from zero to 100 * - * The percentage represents the maximum tolerated percentage of partitions - * that can be unhealthy before the service is considered in error. - * If the percentage is respected but there is at least one unhealthy - * partition, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy partitions - * over the total number of partitions in the service. - * The computation rounds up to tolerate one failure on small numbers of - * partitions. Default percentage is zero. - * @member {number} - * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. Allowed - * values are Byte values from zero to 100. + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * . Default value: 0 . + * @member {number} [maxPercentUnhealthyApplications] The maximum allowed + * percentage of unhealthy applications before reporting an error. For example, + * to allow 10% of applications to be unhealthy, this value would be 10. * - * The percentage represents the maximum tolerated percentage of replicas that - * can be unhealthy before the partition is considered in error. - * If the percentage is respected but there is at least one unhealthy replica, - * the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy replicas - * over the total number of replicas in the partition. - * The computation rounds up to tolerate one failure on small numbers of - * replicas. Default percentage is zero. - * @member {number} - * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed values - * are Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of services that - * can be unhealthy before the application is considered in error. - * If the percentage is respected but there is at least one unhealthy service, - * the health is evaluated as Warning. - * This is calculated by dividing the number of unhealthy services of the - * specific service type over the total number of services of the specific - * service type. + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. * The computation rounds up to tolerate one failure on small numbers of - * services. Default percentage is zero. - * @member {array} - * [upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] - * @member {number} [minimumNodes] The minimum number of nodes where Service - * Fabric will reserve capacity for this application. Note that this does not - * mean that the services of this application will be placed on all of those - * nodes. If this property is set to zero, no capacity will be reserved. The - * value of this property cannot be more than the value of the MaximumNodes - * property. - * @member {number} [maximumNodes] The maximum number of nodes where Service - * Fabric will reserve capacity for this application. Note that this does not - * mean that the services of this application will be placed on all of those - * nodes. By default, the value of this property is zero and it means that the - * services can be placed on any node. Default value: 0 . - * @member {boolean} [removeApplicationCapacity] The version of the application - * type - * @member {array} [metrics] - * @member {string} [provisioningState] The current deployment or provisioning - * state, which only appears in the response - * @member {string} [typeName] - */ -export interface ApplicationResource extends ProxyResource { - typeVersion?: string; - parameters?: ApplicationParameter[]; - upgradePolicy?: ApplicationUpgradePolicy; - minimumNodes?: number; - maximumNodes?: number; - removeApplicationCapacity?: boolean; - metrics?: ApplicationMetricDescription[]; - readonly provisioningState?: string; - typeName?: string; -} - -/** - * @class - * Initializes a new instance of the ApplicationResourceList class. - * @constructor - * The list of application resources. - * - * @member {array} [value] + * applications. Default percentage is zero. + * . Default value: 0 . + * @member {object} [applicationHealthPolicies] Defines the application health + * policy map used to evaluate the health of an application or one of its + * children entities. */ -export interface ApplicationResourceList { - value?: ApplicationResource[]; +export interface ClusterHealthPolicy { + maxPercentUnhealthyNodes?: number; + maxPercentUnhealthyApplications?: number; + applicationHealthPolicies?: { [propertyName: string]: ApplicationHealthPolicy }; } /** * @class - * Initializes a new instance of the RollingUpgradeMonitoringPolicy class. + * Initializes a new instance of the ClusterUpgradeDeltaHealthPolicy class. * @constructor - * The policy used for monitoring the application upgrade + * Describes the delta health policies for the cluster upgrade. * - * @member {string} [healthCheckWaitDuration] - * @member {string} [healthCheckStableDuration] - * @member {string} [healthCheckRetryTimeout] - * @member {string} [upgradeTimeout] - * @member {string} [upgradeDomainTimeout] + * @member {number} maxPercentDeltaUnhealthyNodes The maximum allowed + * percentage of nodes health degradation allowed during cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * @member {number} maxPercentUpgradeDomainDeltaUnhealthyNodes The maximum + * allowed percentage of upgrade domain nodes health degradation allowed during + * cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * @member {number} maxPercentDeltaUnhealthyApplications The maximum allowed + * percentage of applications health degradation allowed during cluster + * upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * @member {object} [applicationDeltaHealthPolicies] Defines the application + * delta health policy map used to evaluate the health of an application or one + * of its child entities when upgrading the cluster. */ -export interface RollingUpgradeMonitoringPolicy { - healthCheckWaitDuration?: string; - healthCheckStableDuration?: string; - healthCheckRetryTimeout?: string; - upgradeTimeout?: string; - upgradeDomainTimeout?: string; +export interface ClusterUpgradeDeltaHealthPolicy { + maxPercentDeltaUnhealthyNodes: number; + maxPercentUpgradeDomainDeltaUnhealthyNodes: number; + maxPercentDeltaUnhealthyApplications: number; + applicationDeltaHealthPolicies?: { [propertyName: string]: ApplicationDeltaHealthPolicy }; } /** * @class - * Initializes a new instance of the ApplicationUpgradePolicy class. + * Initializes a new instance of the ClusterUpgradePolicy class. * @constructor - * The application upgrade policy. + * Describes the policy used when upgrading the cluster. * - * @member {number} [upgradeReplicaSetCheckTimeout] - * @member {boolean} [forceRestart] - * @member {object} [rollingUpgradeMonitoringPolicy] - * @member {string} [rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] - * @member {string} [rollingUpgradeMonitoringPolicy.healthCheckStableDuration] - * @member {string} [rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] - * @member {string} [rollingUpgradeMonitoringPolicy.upgradeTimeout] - * @member {string} [rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] - * @member {object} [applicationHealthPolicy] - * @member {boolean} [applicationHealthPolicy.considerWarningAsError] Indicates - * whether warnings are treated with the same severity as errors. - * @member {number} - * [applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] The - * maximum allowed percentage of unhealthy deployed applications. Allowed - * values are Byte values from zero to 100. - * The percentage represents the maximum tolerated percentage of deployed - * applications that can be unhealthy before the application is considered in - * error. - * This is calculated by dividing the number of unhealthy deployed applications - * over the number of nodes where the application is currently deployed on in + * @member {boolean} [forceRestart] If true, then processes are forcefully + * restarted during upgrade even when the code version has not changed (the + * upgrade only changes configuration or data). + * @member {string} upgradeReplicaSetCheckTimeout The maximum amount of time to + * block processing of an upgrade domain and revent loss of availability when + * there are unexpected issues. When this timeout expires, processing of the + * upgrade domain will proceed regardless of availability loss issues. The + * timeout is reset at the start of each upgrade domain. The timeout can be in + * either hh:mm:ss or in d.hh:mm:ss.ms format. + * @member {string} healthCheckWaitDuration The length of time to wait after + * completing an upgrade domain before performing health checks. The duration + * can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @member {string} healthCheckStableDuration The amount of time that the + * application or cluster must remain healthy before the upgrade proceeds to + * the next upgrade domain. The duration can be in either hh:mm:ss or in + * d.hh:mm:ss.ms format. + * @member {string} healthCheckRetryTimeout The amount of time to retry health + * evaluation when the application or cluster is unhealthy before the upgrade + * rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms + * format. + * @member {string} upgradeTimeout The amount of time the overall upgrade has + * to complete before the upgrade rolls back. The timeout can be in either + * hh:mm:ss or in d.hh:mm:ss.ms format. + * @member {string} upgradeDomainTimeout The amount of time each upgrade domain + * has to complete before the upgrade rolls back. The timeout can be in either + * hh:mm:ss or in d.hh:mm:ss.ms format. + * @member {object} healthPolicy The cluster health policy used when upgrading * the cluster. + * @member {number} [healthPolicy.maxPercentUnhealthyNodes] The maximum allowed + * percentage of unhealthy nodes before reporting an error. For example, to + * allow 10% of nodes to be unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. - * @member {object} [applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * @member {number} - * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. Allowed - * values are Byte values from zero to 100 * - * The percentage represents the maximum tolerated percentage of partitions - * that can be unhealthy before the service is considered in error. - * If the percentage is respected but there is at least one unhealthy - * partition, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy partitions - * over the total number of partitions in the service. - * The computation rounds up to tolerate one failure on small numbers of - * partitions. Default percentage is zero. - * @member {number} - * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. Allowed - * values are Byte values from zero to 100. + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * @member {number} [healthPolicy.maxPercentUnhealthyApplications] The maximum + * allowed percentage of unhealthy applications before reporting an error. For + * example, to allow 10% of applications to be unhealthy, this value would be + * 10. * - * The percentage represents the maximum tolerated percentage of replicas that - * can be unhealthy before the partition is considered in error. - * If the percentage is respected but there is at least one unhealthy replica, - * the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy replicas - * over the total number of replicas in the partition. + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. * The computation rounds up to tolerate one failure on small numbers of - * replicas. Default percentage is zero. + * applications. Default percentage is zero. + * @member {object} [healthPolicy.applicationHealthPolicies] Defines the + * application health policy map used to evaluate the health of an application + * or one of its children entities. + * @member {object} [deltaHealthPolicy] The cluster delta health policy used + * when upgrading the cluster. + * @member {number} [deltaHealthPolicy.maxPercentDeltaUnhealthyNodes] The + * maximum allowed percentage of nodes health degradation allowed during + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. * @member {number} - * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed values - * are Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of services that - * can be unhealthy before the application is considered in error. - * If the percentage is respected but there is at least one unhealthy service, - * the health is evaluated as Warning. - * This is calculated by dividing the number of unhealthy services of the - * specific service type over the total number of services of the specific - * service type. - * The computation rounds up to tolerate one failure on small numbers of - * services. Default percentage is zero. - * @member {array} [applicationHealthPolicy.serviceTypeHealthPolicyMap] + * [deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes] The maximum + * allowed percentage of upgrade domain nodes health degradation allowed during + * cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * @member {number} [deltaHealthPolicy.maxPercentDeltaUnhealthyApplications] + * The maximum allowed percentage of applications health degradation allowed + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * @member {object} [deltaHealthPolicy.applicationDeltaHealthPolicies] Defines + * the application delta health policy map used to evaluate the health of an + * application or one of its child entities when upgrading the cluster. */ -export interface ApplicationUpgradePolicy { - upgradeReplicaSetCheckTimeout?: number; +export interface ClusterUpgradePolicy { forceRestart?: boolean; - rollingUpgradeMonitoringPolicy?: RollingUpgradeMonitoringPolicy; - applicationHealthPolicy?: ApplicationHealthPolicy; + upgradeReplicaSetCheckTimeout: string; + healthCheckWaitDuration: string; + healthCheckStableDuration: string; + healthCheckRetryTimeout: string; + upgradeTimeout: string; + upgradeDomainTimeout: string; + healthPolicy: ClusterHealthPolicy; + deltaHealthPolicy?: ClusterUpgradeDeltaHealthPolicy; } /** * @class - * Initializes a new instance of the ApplicationResourceUpdate class. + * Initializes a new instance of the Resource class. * @constructor - * The application resource for patch operations. + * The resource model definition. * - * @member {string} [typeVersion] - * @member {array} [parameters] - * @member {object} [upgradePolicy] - * @member {number} [upgradePolicy.upgradeReplicaSetCheckTimeout] - * @member {boolean} [upgradePolicy.forceRestart] - * @member {object} [upgradePolicy.rollingUpgradeMonitoringPolicy] - * @member {string} - * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] - * @member {string} - * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] - * @member {string} - * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] - * @member {string} - * [upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] - * @member {string} - * [upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] - * @member {object} [upgradePolicy.applicationHealthPolicy] - * @member {boolean} - * [upgradePolicy.applicationHealthPolicy.considerWarningAsError] Indicates - * whether warnings are treated with the same severity as errors. - * @member {number} - * [upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] - * The maximum allowed percentage of unhealthy deployed applications. Allowed - * values are Byte values from zero to 100. - * The percentage represents the maximum tolerated percentage of deployed - * applications that can be unhealthy before the application is considered in - * error. - * This is calculated by dividing the number of unhealthy deployed applications - * over the number of nodes where the application is currently deployed on in + * @member {string} [id] Azure resource identifier. + * @member {string} [name] Azure resource name. + * @member {string} [type] Azure resource type. + * @member {string} location Azure resource location. + * @member {object} [tags] Azure resource tags. + */ +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 Cluster class. + * @constructor + * The cluster resource + * + * + * @member {array} [addOnFeatures] The list of add-on features to enable in the + * cluster. + * @member {array} [availableClusterVersions] The Service Fabric runtime + * versions available for this cluster. + * @member {object} [azureActiveDirectory] The AAD authentication settings of * the cluster. + * @member {string} [azureActiveDirectory.tenantId] Azure active directory + * tenant id. + * @member {string} [azureActiveDirectory.clusterApplication] Azure active + * directory cluster application id. + * @member {string} [azureActiveDirectory.clientApplication] Azure active + * directory client application id. + * @member {object} [certificate] The certificate to use for securing the + * cluster. The certificate provided will be used for node to node security + * within the cluster, SSL certificate for cluster management endpoint and + * default admin client. + * @member {string} [certificate.thumbprint] Thumbprint of the primary + * certificate. + * @member {string} [certificate.thumbprintSecondary] Thumbprint of the + * secondary certificate. + * @member {string} [certificate.x509StoreName] The local certificate store + * location. Possible values include: 'AddressBook', 'AuthRoot', + * 'CertificateAuthority', 'Disallowed', 'My', 'Root', 'TrustedPeople', + * 'TrustedPublisher' + * @member {object} [certificateCommonNames] Describes a list of server + * certificates referenced by common name that are used to secure the cluster. + * @member {array} [certificateCommonNames.commonNames] The list of server + * certificates referenced by common name that are used to secure the cluster. + * @member {string} [certificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' + * @member {array} [clientCertificateCommonNames] The list of client + * certificates referenced by common name that are allowed to manage the + * cluster. + * @member {array} [clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. + * @member {string} [clusterCodeVersion] The Service Fabric runtime version of + * the cluster. This property can only by set the user when **upgradeMode** is + * set to 'Manual'. To get list of available Service Fabric versions for new + * clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of + * available version for existing clusters use **availableClusterVersions**. + * @member {string} [clusterEndpoint] The Azure Resource Provider endpoint. A + * system service in the cluster connects to this endpoint. + * @member {string} [clusterId] A service generated unique identifier for the + * cluster resource. + * @member {string} [clusterState] The current state of the cluster. + * + * - WaitingForNodes - Indicates that the cluster resource is created and the + * resource provider is waiting for Service Fabric VM extension to boot up and + * report to it. + * - Deploying - Indicates that the Service Fabric runtime is being installed + * on the VMs. Cluster resource will be in this state until the cluster boots + * up and system services are up. + * - BaselineUpgrade - Indicates that the cluster is upgrading to establishes + * the cluster version. This upgrade is automatically initiated when the + * cluster boots up for the first time. + * - UpdatingUserConfiguration - Indicates that the cluster is being upgraded + * with the user provided configuration. + * - UpdatingUserCertificate - Indicates that the cluster is being upgraded + * with the user provided certificate. + * - UpdatingInfrastructure - Indicates that the cluster is being upgraded with + * the latest Service Fabric runtime version. This happens only when the + * **upgradeMode** is set to 'Automatic'. + * - EnforcingClusterVersion - Indicates that cluster is on a different version + * than expected and the cluster is being upgraded to the expected version. + * - UpgradeServiceUnreachable - Indicates that the system service in the + * cluster is no longer polling the Resource Provider. Clusters in this state + * cannot be managed by the Resource Provider. + * - AutoScale - Indicates that the ReliabilityLevel of the cluster is being + * adjusted. + * - Ready - Indicates that the cluster is in a stable state. + * . Possible values include: 'WaitingForNodes', 'Deploying', + * 'BaselineUpgrade', 'UpdatingUserConfiguration', 'UpdatingUserCertificate', + * 'UpdatingInfrastructure', 'EnforcingClusterVersion', + * 'UpgradeServiceUnreachable', 'AutoScale', 'Ready' + * @member {object} [diagnosticsStorageAccountConfig] The storage account + * information for storing Service Fabric diagnostic logs. + * @member {string} [diagnosticsStorageAccountConfig.storageAccountName] The + * Azure storage account name. + * @member {string} [diagnosticsStorageAccountConfig.protectedAccountKeyName] + * The protected diagnostics storage key name. + * @member {string} [diagnosticsStorageAccountConfig.blobEndpoint] The blob + * endpoint of the azure storage account. + * @member {string} [diagnosticsStorageAccountConfig.queueEndpoint] The queue + * endpoint of the azure storage account. + * @member {string} [diagnosticsStorageAccountConfig.tableEndpoint] The table + * endpoint of the azure storage account. + * @member {array} [fabricSettings] The list of custom fabric settings to + * configure the cluster. + * @member {string} managementEndpoint The http management endpoint of the + * cluster. + * @member {array} nodeTypes The list of node types in the cluster. + * @member {string} [provisioningState] The provisioning state of the cluster + * resource. Possible values include: 'Updating', 'Succeeded', 'Failed', + * 'Canceled' + * @member {string} [reliabilityLevel] The reliability level sets the replica + * set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + * + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' + * @member {object} [reverseProxyCertificate] The server certificate used by + * reverse proxy. + * @member {string} [reverseProxyCertificate.thumbprint] Thumbprint of the + * primary certificate. + * @member {string} [reverseProxyCertificate.thumbprintSecondary] Thumbprint of + * the secondary certificate. + * @member {string} [reverseProxyCertificate.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' + * @member {object} [reverseProxyCertificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the + * cluster. + * @member {array} [reverseProxyCertificateCommonNames.commonNames] The list of + * server certificates referenced by common name that are used to secure the + * cluster. + * @member {string} [reverseProxyCertificateCommonNames.x509StoreName] The + * local certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' + * @member {object} [upgradeDescription] The policy to use when upgrading the + * cluster. + * @member {boolean} [upgradeDescription.forceRestart] If true, then processes + * are forcefully restarted during upgrade even when the code version has not + * changed (the upgrade only changes configuration or data). + * @member {string} [upgradeDescription.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and revent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @member {string} [upgradeDescription.healthCheckWaitDuration] The length of + * time to wait after completing an upgrade domain before performing health + * checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @member {string} [upgradeDescription.healthCheckStableDuration] The amount + * of time that the application or cluster must remain healthy before the + * upgrade proceeds to the next upgrade domain. The duration can be in either + * hh:mm:ss or in d.hh:mm:ss.ms format. + * @member {string} [upgradeDescription.healthCheckRetryTimeout] The amount of + * time to retry health evaluation when the application or cluster is unhealthy + * before the upgrade rolls back. The timeout can be in either hh:mm:ss or in + * d.hh:mm:ss.ms format. + * @member {string} [upgradeDescription.upgradeTimeout] The amount of time the + * overall upgrade has to complete before the upgrade rolls back. The timeout + * can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @member {string} [upgradeDescription.upgradeDomainTimeout] The amount of + * time each upgrade domain has to complete before the upgrade rolls back. The + * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @member {object} [upgradeDescription.healthPolicy] The cluster health policy + * used when upgrading the cluster. + * @member {number} [upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] + * The maximum allowed percentage of unhealthy nodes before reporting an error. + * For example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. * The computation rounds up to tolerate one failure on small numbers of nodes. * Default percentage is zero. - * @member {object} - * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. * @member {number} - * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. Allowed - * values are Byte values from zero to 100 + * [upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] The + * maximum allowed percentage of unhealthy applications before reporting an + * error. For example, to allow 10% of applications to be unhealthy, this value + * would be 10. * - * The percentage represents the maximum tolerated percentage of partitions - * that can be unhealthy before the service is considered in error. + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. * If the percentage is respected but there is at least one unhealthy - * partition, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy partitions - * over the total number of partitions in the service. + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. * The computation rounds up to tolerate one failure on small numbers of - * partitions. Default percentage is zero. + * applications. Default percentage is zero. + * @member {object} [upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * @member {object} [upgradeDescription.deltaHealthPolicy] The cluster delta + * health policy used when upgrading the cluster. * @member {number} - * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. Allowed - * values are Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of replicas that - * can be unhealthy before the partition is considered in error. - * If the percentage is respected but there is at least one unhealthy replica, - * the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy replicas - * over the total number of replicas in the partition. - * The computation rounds up to tolerate one failure on small numbers of - * replicas. Default percentage is zero. + * [upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes] The + * maximum allowed percentage of nodes health degradation allowed during + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. * @member {number} - * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed values - * are Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of services that - * can be unhealthy before the application is considered in error. - * If the percentage is respected but there is at least one unhealthy service, - * the health is evaluated as Warning. - * This is calculated by dividing the number of unhealthy services of the - * specific service type over the total number of services of the specific - * service type. - * The computation rounds up to tolerate one failure on small numbers of - * services. Default percentage is zero. - * @member {array} - * [upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] - * @member {number} [minimumNodes] The minimum number of nodes where Service - * Fabric will reserve capacity for this application. Note that this does not - * mean that the services of this application will be placed on all of those - * nodes. If this property is set to zero, no capacity will be reserved. The - * value of this property cannot be more than the value of the MaximumNodes - * property. - * @member {number} [maximumNodes] The maximum number of nodes where Service - * Fabric will reserve capacity for this application. Note that this does not - * mean that the services of this application will be placed on all of those - * nodes. By default, the value of this property is zero and it means that the - * services can be placed on any node. Default value: 0 . - * @member {boolean} [removeApplicationCapacity] The version of the application - * type - * @member {array} [metrics] + * [upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes] + * The maximum allowed percentage of upgrade domain nodes health degradation + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * @member {number} + * [upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications] + * The maximum allowed percentage of applications health degradation allowed + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * @member {object} + * [upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. + * @member {string} [upgradeMode] The upgrade mode of the cluster when new + * Service Fabric runtime version is available. + * + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' + * @member {string} [vmImage] The VM image VMSS has been configured with. + * Generic names such as Windows or Linux can be used. */ -export interface ApplicationResourceUpdate extends ProxyResource { - typeVersion?: string; - parameters?: ApplicationParameter[]; - upgradePolicy?: ApplicationUpgradePolicy; - minimumNodes?: number; - maximumNodes?: number; - removeApplicationCapacity?: boolean; - metrics?: ApplicationMetricDescription[]; +export interface Cluster extends Resource { + addOnFeatures?: string[]; + readonly availableClusterVersions?: ClusterVersionDetails[]; + azureActiveDirectory?: AzureActiveDirectory; + certificate?: CertificateDescription; + certificateCommonNames?: ServerCertificateCommonNames; + clientCertificateCommonNames?: ClientCertificateCommonName[]; + clientCertificateThumbprints?: ClientCertificateThumbprint[]; + clusterCodeVersion?: string; + readonly clusterEndpoint?: string; + readonly clusterId?: string; + readonly clusterState?: string; + diagnosticsStorageAccountConfig?: DiagnosticsStorageAccountConfig; + fabricSettings?: SettingsSectionDescription[]; + managementEndpoint: string; + nodeTypes: NodeTypeDescription[]; + readonly provisioningState?: string; + reliabilityLevel?: string; + reverseProxyCertificate?: CertificateDescription; + reverseProxyCertificateCommonNames?: ServerCertificateCommonNames; + upgradeDescription?: ClusterUpgradePolicy; + upgradeMode?: string; + vmImage?: string; } /** * @class - * Initializes a new instance of the ServicePropertiesBase class. + * Initializes a new instance of the ClusterCodeVersionsResult class. * @constructor - * The common service resource properties. + * The result of the ServiceFabric runtime versions * - * @member {string} [placementConstraints] The placement constraints as a - * string. Placement constraints are boolean expressions on node properties and - * allow for restricting a service to particular nodes based on the service - * requirements. For example, to place a service on nodes where NodeType is - * blue specify the following: "NodeColor == blue)". - * @member {array} [correlationScheme] - * @member {array} [serviceLoadMetrics] - * @member {array} [servicePlacementPolicies] - * @member {string} [defaultMoveCost] Possible values include: 'Zero', 'Low', - * 'Medium', 'High' + * @member {string} [id] The identification of the result + * @member {string} [name] The name of the result + * @member {string} [type] The result resource type + * @member {string} [codeVersion] The Service Fabric runtime version of the + * cluster. + * @member {string} [supportExpiryUtc] The date of expiry of support of the + * version. + * @member {string} [environment] Indicates if this version is for Windows or + * Linux operating system. Possible values include: 'Windows', 'Linux' */ -export interface ServicePropertiesBase { - placementConstraints?: string; - correlationScheme?: ServiceCorrelationDescription[]; - serviceLoadMetrics?: ServiceLoadMetricDescription[]; - servicePlacementPolicies?: ServicePlacementPolicyDescription[]; - defaultMoveCost?: string; +export interface ClusterCodeVersionsResult { + id?: string; + name?: string; + type?: string; + codeVersion?: string; + supportExpiryUtc?: string; + environment?: string; } /** * @class - * Initializes a new instance of the ServiceProperties class. + * Initializes a new instance of the ClusterCodeVersionsListResult class. * @constructor - * The service resource properties. + * The list results of the ServiceFabric runtime versions. * - * @member {string} [provisioningState] The current deployment or provisioning - * state, which only appears in the response - * @member {string} [serviceKind] Possible values include: 'Invalid', - * 'Stateless', 'Stateful' - * @member {string} [serviceTypeName] The name of the service type - * @member {object} [partitionDescription] - * @member {string} [partitionDescription.partitionScheme] Polymorphic - * Discriminator - * @member {string} serviceResourceType Polymorphic Discriminator + * @member {array} [value] + * @member {string} [nextLink] The URL to use for getting the next set of + * results. */ -export interface ServiceProperties extends ServicePropertiesBase { - readonly provisioningState?: string; - serviceKind?: string; - serviceTypeName?: string; - partitionDescription?: PartitionSchemeDescription; - serviceResourceType: string; +export interface ClusterCodeVersionsListResult { + value?: ClusterCodeVersionsResult[]; + nextLink?: string; } /** * @class - * Initializes a new instance of the ServiceResource class. + * Initializes a new instance of the ClusterListResult class. * @constructor - * The service resource. + * Cluster list results * - * @member {string} [placementConstraints] The placement constraints as a - * string. Placement constraints are boolean expressions on node properties and - * allow for restricting a service to particular nodes based on the service - * requirements. For example, to place a service on nodes where NodeType is - * blue specify the following: "NodeColor == blue)". - * @member {array} [correlationScheme] - * @member {array} [serviceLoadMetrics] - * @member {array} [servicePlacementPolicies] - * @member {string} [defaultMoveCost] Possible values include: 'Zero', 'Low', - * 'Medium', 'High' - * @member {string} [provisioningState] The current deployment or provisioning - * state, which only appears in the response - * @member {string} [serviceKind] Possible values include: 'Invalid', - * 'Stateless', 'Stateful' - * @member {string} [serviceTypeName] The name of the service type - * @member {object} [partitionDescription] - * @member {string} [partitionDescription.partitionScheme] Polymorphic - * Discriminator - * @member {string} serviceResourceType Polymorphic Discriminator + * @member {array} [value] + * @member {string} [nextLink] The URL to use for getting the next set of + * results. */ -export interface ServiceResource extends ProxyResource { - placementConstraints?: string; - correlationScheme?: ServiceCorrelationDescription[]; - serviceLoadMetrics?: ServiceLoadMetricDescription[]; - servicePlacementPolicies?: ServicePlacementPolicyDescription[]; - defaultMoveCost?: string; - readonly provisioningState?: string; - serviceKind?: string; - serviceTypeName?: string; - partitionDescription?: PartitionSchemeDescription; - serviceResourceType: string; +export interface ClusterListResult { + value?: Cluster[]; + nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ClusterUpdateParameters class. + * @constructor + * Cluster update request + * + * @member {array} [addOnFeatures] The list of add-on features to enable in the + * cluster. + * @member {object} [certificate] The certificate to use for securing the + * cluster. The certificate provided will be used for node to node security + * within the cluster, SSL certificate for cluster management endpoint and + * default admin client. + * @member {string} [certificate.thumbprint] Thumbprint of the primary + * certificate. + * @member {string} [certificate.thumbprintSecondary] Thumbprint of the + * secondary certificate. + * @member {string} [certificate.x509StoreName] The local certificate store + * location. Possible values include: 'AddressBook', 'AuthRoot', + * 'CertificateAuthority', 'Disallowed', 'My', 'Root', 'TrustedPeople', + * 'TrustedPublisher' + * @member {object} [certificateCommonNames] Describes a list of server + * certificates referenced by common name that are used to secure the cluster. + * @member {array} [certificateCommonNames.commonNames] The list of server + * certificates referenced by common name that are used to secure the cluster. + * @member {string} [certificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' + * @member {array} [clientCertificateCommonNames] The list of client + * certificates referenced by common name that are allowed to manage the + * cluster. This will overwrite the existing list. + * @member {array} [clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. This will overwrite the existing list. + * @member {string} [clusterCodeVersion] The Service Fabric runtime version of + * the cluster. This property can only by set the user when **upgradeMode** is + * set to 'Manual'. To get list of available Service Fabric versions for new + * clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of + * available version for existing clusters use **availableClusterVersions**. + * @member {array} [fabricSettings] The list of custom fabric settings to + * configure the cluster. This will overwrite the existing list. + * @member {array} [nodeTypes] The list of node types in the cluster. This will + * overwrite the existing list. + * @member {string} [reliabilityLevel] The reliability level sets the replica + * set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + * + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' + * @member {object} [reverseProxyCertificate] The server certificate used by + * reverse proxy. + * @member {string} [reverseProxyCertificate.thumbprint] Thumbprint of the + * primary certificate. + * @member {string} [reverseProxyCertificate.thumbprintSecondary] Thumbprint of + * the secondary certificate. + * @member {string} [reverseProxyCertificate.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' + * @member {object} [upgradeDescription] The policy to use when upgrading the + * cluster. + * @member {boolean} [upgradeDescription.forceRestart] If true, then processes + * are forcefully restarted during upgrade even when the code version has not + * changed (the upgrade only changes configuration or data). + * @member {string} [upgradeDescription.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and revent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @member {string} [upgradeDescription.healthCheckWaitDuration] The length of + * time to wait after completing an upgrade domain before performing health + * checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @member {string} [upgradeDescription.healthCheckStableDuration] The amount + * of time that the application or cluster must remain healthy before the + * upgrade proceeds to the next upgrade domain. The duration can be in either + * hh:mm:ss or in d.hh:mm:ss.ms format. + * @member {string} [upgradeDescription.healthCheckRetryTimeout] The amount of + * time to retry health evaluation when the application or cluster is unhealthy + * before the upgrade rolls back. The timeout can be in either hh:mm:ss or in + * d.hh:mm:ss.ms format. + * @member {string} [upgradeDescription.upgradeTimeout] The amount of time the + * overall upgrade has to complete before the upgrade rolls back. The timeout + * can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @member {string} [upgradeDescription.upgradeDomainTimeout] The amount of + * time each upgrade domain has to complete before the upgrade rolls back. The + * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @member {object} [upgradeDescription.healthPolicy] The cluster health policy + * used when upgrading the cluster. + * @member {number} [upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] + * The maximum allowed percentage of unhealthy nodes before reporting an error. + * For example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * @member {number} + * [upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] The + * maximum allowed percentage of unhealthy applications before reporting an + * error. For example, to allow 10% of applications to be unhealthy, this value + * would be 10. + * + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * @member {object} [upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * @member {object} [upgradeDescription.deltaHealthPolicy] The cluster delta + * health policy used when upgrading the cluster. + * @member {number} + * [upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes] The + * maximum allowed percentage of nodes health degradation allowed during + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * @member {number} + * [upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes] + * The maximum allowed percentage of upgrade domain nodes health degradation + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * @member {number} + * [upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications] + * The maximum allowed percentage of applications health degradation allowed + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * @member {object} + * [upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. + * @member {string} [upgradeMode] The upgrade mode of the cluster when new + * Service Fabric runtime version is available. + * + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' + * @member {object} [tags] Cluster update parameters + */ +export interface ClusterUpdateParameters { + addOnFeatures?: string[]; + certificate?: CertificateDescription; + certificateCommonNames?: ServerCertificateCommonNames; + clientCertificateCommonNames?: ClientCertificateCommonName[]; + clientCertificateThumbprints?: ClientCertificateThumbprint[]; + clusterCodeVersion?: string; + fabricSettings?: SettingsSectionDescription[]; + nodeTypes?: NodeTypeDescription[]; + reliabilityLevel?: string; + reverseProxyCertificate?: CertificateDescription; + upgradeDescription?: ClusterUpgradePolicy; + upgradeMode?: string; + tags?: { [propertyName: string]: string }; } /** * @class - * Initializes a new instance of the ServiceResourceList class. + * Initializes a new instance of the OperationResult class. * @constructor - * The list of service resources. + * Available operation list result * - * @member {array} [value] + * @member {string} [name] The name of the operation. + * @member {object} [display] The object that represents the operation. + * @member {string} [display.provider] The name of the provider. + * @member {string} [display.resource] The resource on which the operation is + * performed + * @member {string} [display.operation] The operation that can be performed. + * @member {string} [display.description] Operation description + * @member {string} [origin] Origin result + * @member {string} [nextLink] The URL to use for getting the next set of + * results. */ -export interface ServiceResourceList { - value?: ServiceResource[]; +export interface OperationResult { + name?: string; + display?: AvailableOperationDisplay; + origin?: string; + nextLink?: string; } /** * @class - * Initializes a new instance of the ServiceUpdateProperties class. + * Initializes a new instance of the ErrorModelError class. * @constructor - * The service resource properties for patch operations. + * The error details. * - * @member {string} serviceResourceType Polymorphic Discriminator + * @member {string} [code] The error code. + * @member {string} [message] The error message. */ -export interface ServiceUpdateProperties extends ServicePropertiesBase { - serviceResourceType: string; +export interface ErrorModelError { + code?: string; + message?: string; } /** * @class - * Initializes a new instance of the ServiceResourceUpdate class. + * Initializes a new instance of the ErrorModel class. * @constructor - * The service resource for patch operations. + * The structure of the error. * - * @member {string} [placementConstraints] The placement constraints as a - * string. Placement constraints are boolean expressions on node properties and - * allow for restricting a service to particular nodes based on the service - * requirements. For example, to place a service on nodes where NodeType is - * blue specify the following: "NodeColor == blue)". - * @member {array} [correlationScheme] - * @member {array} [serviceLoadMetrics] - * @member {array} [servicePlacementPolicies] - * @member {string} [defaultMoveCost] Possible values include: 'Zero', 'Low', - * 'Medium', 'High' - * @member {string} serviceResourceType Polymorphic Discriminator + * @member {object} [error] The error details. + * @member {string} [error.code] The error code. + * @member {string} [error.message] The error message. */ -export interface ServiceResourceUpdate extends ProxyResource { - placementConstraints?: string; - correlationScheme?: ServiceCorrelationDescription[]; - serviceLoadMetrics?: ServiceLoadMetricDescription[]; - servicePlacementPolicies?: ServicePlacementPolicyDescription[]; - defaultMoveCost?: string; - serviceResourceType: string; +export interface ErrorModel { + error?: ErrorModelError; } /** * @class - * Initializes a new instance of the StatelessService class. + * Initializes a new instance of the ApplicationMetricDescription class. * @constructor - * The properties of a stateless service resource. + * Describes capacity information for a custom resource balancing metric. This + * can be used to limit the total consumption of this metric by the services of + * this application. * - * @member {number} [instanceCount] The instance count. + * + * @member {string} [name] The name of the metric. + * @member {number} [maximumCapacity] The maximum node capacity for Service + * Fabric application. + * This is the maximum Load for an instance of this application on a single + * node. Even if the capacity of node is greater than this value, Service + * Fabric will limit the total load of services within the application on each + * node to this value. + * If set to zero, capacity for this metric is unlimited on each node. + * When creating a new application with application capacity defined, the + * product of MaximumNodes and this value must always be smaller than or equal + * to TotalApplicationCapacity. + * When updating existing application with application capacity, the product of + * MaximumNodes and this value must always be smaller than or equal to + * TotalApplicationCapacity. + * @member {number} [reservationCapacity] The node reservation capacity for + * Service Fabric application. + * This is the amount of load which is reserved on nodes which have instances + * of this application. + * If MinimumNodes is specified, then the product of these values will be the + * capacity reserved in the cluster for the application. + * If set to zero, no capacity is reserved for this metric. + * When setting application capacity or when updating application capacity; + * this value must be smaller than or equal to MaximumCapacity for each metric. + * @member {number} [totalApplicationCapacity] The total metric capacity for + * Service Fabric application. + * This is the total metric capacity for this application in the cluster. + * Service Fabric will try to limit the sum of loads of services within the + * application to this value. + * When creating a new application with application capacity defined, the + * product of MaximumNodes and MaximumCapacity must always be smaller than or + * equal to this value. */ -export interface StatelessService extends ServiceProperties { - instanceCount?: number; +export interface ApplicationMetricDescription { + name?: string; + maximumCapacity?: number; + reservationCapacity?: number; + totalApplicationCapacity?: number; } /** * @class - * Initializes a new instance of the StatelessServiceUpdate class. + * Initializes a new instance of the ServiceCorrelationDescription class. * @constructor - * The properties of a stateless service resource for patch operations. + * Creates a particular correlation between services. * - * @member {number} [instanceCount] The instance count. + * @member {string} scheme The ServiceCorrelationScheme which describes the + * relationship between this service and the service specified via ServiceName. + * Possible values include: 'Invalid', 'Affinity', 'AlignedAffinity', + * 'NonAlignedAffinity' + * @member {string} serviceName The name of the service that the correlation + * relationship is established with. */ -export interface StatelessServiceUpdate extends ServiceUpdateProperties { - instanceCount?: number; +export interface ServiceCorrelationDescription { + scheme: string; + serviceName: string; } /** * @class - * Initializes a new instance of the StatefulService class. + * Initializes a new instance of the ServiceLoadMetricDescription class. * @constructor - * The properties of a stateful service resource. + * Specifies a metric to load balance a service during runtime. * - * @member {boolean} [hasPersistedState] A flag indicating whether this is a - * persistent service which stores states on the local disk. If it is then the - * value of this property is true, if not it is false. - * @member {number} [targetReplicaSetSize] The target replica set size as a - * number. - * @member {number} [minReplicaSetSize] The minimum replica set size as a - * number. - * @member {date} [replicaRestartWaitDuration] The duration between when a - * replica goes down and when a new replica is created, represented in ISO 8601 - * format (hh:mm:ss.s). - * @member {date} [quorumLossWaitDuration] The maximum duration for which a - * partition is allowed to be in a state of quorum loss, represented in ISO - * 8601 format (hh:mm:ss.s). - * @member {date} [standByReplicaKeepDuration] The definition on how long - * StandBy replicas should be maintained before being removed, represented in - * ISO 8601 format (hh:mm:ss.s). + * @member {string} name The name of the metric. If the service chooses to + * report load during runtime, the load metric name should match the name that + * is specified in Name exactly. Note that metric names are case sensitive. + * @member {string} [weight] The service load metric relative weight, compared + * to other metrics configured for this service, as a number. Possible values + * include: 'Zero', 'Low', 'Medium', 'High' + * @member {number} [primaryDefaultLoad] Used only for Stateful services. The + * default amount of load, as a number, that this service creates for this + * metric when it is a Primary replica. + * @member {number} [secondaryDefaultLoad] Used only for Stateful services. The + * default amount of load, as a number, that this service creates for this + * metric when it is a Secondary replica. + * @member {number} [defaultLoad] Used only for Stateless services. The default + * amount of load, as a number, that this service creates for this metric. */ -export interface StatefulService extends ServiceProperties { - hasPersistedState?: boolean; - targetReplicaSetSize?: number; - minReplicaSetSize?: number; - replicaRestartWaitDuration?: Date; - quorumLossWaitDuration?: Date; - standByReplicaKeepDuration?: Date; +export interface ServiceLoadMetricDescription { + name: string; + weight?: string; + primaryDefaultLoad?: number; + secondaryDefaultLoad?: number; + defaultLoad?: number; } /** * @class - * Initializes a new instance of the StatefulServiceUpdate class. + * Initializes a new instance of the ServicePlacementPolicyDescription class. * @constructor - * The properties of a stateful service resource for patch operations. + * Describes the policy to be used for placement of a Service Fabric service. * - * @member {number} [targetReplicaSetSize] The target replica set size as a - * number. - * @member {number} [minReplicaSetSize] The minimum replica set size as a - * number. - * @member {date} [replicaRestartWaitDuration] The duration between when a - * replica goes down and when a new replica is created, represented in ISO 8601 - * format (hh:mm:ss.s). - * @member {date} [quorumLossWaitDuration] The maximum duration for which a - * partition is allowed to be in a state of quorum loss, represented in ISO - * 8601 format (hh:mm:ss.s). - * @member {date} [standByReplicaKeepDuration] The definition on how long - * StandBy replicas should be maintained before being removed, represented in - * ISO 8601 format (hh:mm:ss.s). + * @member {string} type Polymorphic Discriminator */ -export interface StatefulServiceUpdate extends ServiceUpdateProperties { - targetReplicaSetSize?: number; - minReplicaSetSize?: number; - replicaRestartWaitDuration?: Date; - quorumLossWaitDuration?: Date; - standByReplicaKeepDuration?: Date; +export interface ServicePlacementPolicyDescription { + type: string; } /** * @class - * Initializes a new instance of the AvailableOperationDisplay class. + * Initializes a new instance of the PartitionSchemeDescription class. * @constructor - * Operation supported by Service Fabric resource provider + * Describes how the service is partitioned. * - * @member {string} [provider] The name of the provider. - * @member {string} [resource] The resource on which the operation is performed - * @member {string} [operation] The operation that can be performed. - * @member {string} [description] Operation description + * @member {string} partitionScheme Polymorphic Discriminator */ -export interface AvailableOperationDisplay { - provider?: string; - resource?: string; - operation?: string; - description?: string; +export interface PartitionSchemeDescription { + partitionScheme: string; } /** * @class - * Initializes a new instance of the AzureActiveDirectory class. + * Initializes a new instance of the NamedPartitionSchemeDescription class. * @constructor - * The settings to enable AAD authentication on the cluster. + * Describes the named partition scheme of the service. * - * @member {string} [tenantId] Azure active directory tenant id. - * @member {string} [clusterApplication] Azure active directory cluster - * application id. - * @member {string} [clientApplication] Azure active directory client - * application id. + * @member {number} count The number of partitions. + * @member {array} names Array of size specified by the ‘Count’ parameter, for + * the names of the partitions. */ -export interface AzureActiveDirectory { - tenantId?: string; - clusterApplication?: string; - clientApplication?: string; +export interface NamedPartitionSchemeDescription extends PartitionSchemeDescription { + count: number; + names: string[]; } /** * @class - * Initializes a new instance of the CertificateDescription class. + * Initializes a new instance of the SingletonPartitionSchemeDescription class. * @constructor - * Describes the certificate details. + * Describes the partition scheme of a singleton-partitioned, or + * non-partitioned service. * - * @member {string} thumbprint Thumbprint of the primary certificate. - * @member {string} [thumbprintSecondary] Thumbprint of the secondary - * certificate. - * @member {string} [x509StoreName] The local certificate store location. - * Possible values include: 'AddressBook', 'AuthRoot', 'CertificateAuthority', - * 'Disallowed', 'My', 'Root', 'TrustedPeople', 'TrustedPublisher' */ -export interface CertificateDescription { - thumbprint: string; - thumbprintSecondary?: string; - x509StoreName?: string; +export interface SingletonPartitionSchemeDescription extends PartitionSchemeDescription { } /** * @class - * Initializes a new instance of the ClientCertificateCommonName class. + * Initializes a new instance of the UniformInt64RangePartitionSchemeDescription class. * @constructor - * Describes the client certificate details using common name. + * Describes a partitioning scheme where an integer range is allocated evenly + * across a number of partitions. * - * @member {boolean} isAdmin Indicates if the client certificate has admin - * access to the cluster. Non admin clients can perform only read only - * operations on the cluster. - * @member {string} certificateCommonName The common name of the client - * certificate. - * @member {string} certificateIssuerThumbprint The issuer thumbprint of the - * client certificate. + * @member {number} count The number of partitions. + * @member {string} lowKey String indicating the lower bound of the partition + * key range that + * should be split between the partition ‘Count’ + * @member {string} highKey String indicating the upper bound of the partition + * key range that + * should be split between the partition ‘Count’ */ -export interface ClientCertificateCommonName { - isAdmin: boolean; - certificateCommonName: string; - certificateIssuerThumbprint: string; +export interface UniformInt64RangePartitionSchemeDescription extends PartitionSchemeDescription { + count: number; + lowKey: string; + highKey: string; } /** * @class - * Initializes a new instance of the ClientCertificateThumbprint class. + * Initializes a new instance of the ProxyResource class. * @constructor - * Describes the client certificate details using thumbprint. + * The resource model definition for proxy-only resource. * - * @member {boolean} isAdmin Indicates if the client certificate has admin - * access to the cluster. Non admin clients can perform only read only - * operations on the cluster. - * @member {string} certificateThumbprint The thumbprint of the client - * certificate. + * @member {string} [id] Azure resource identifier. + * @member {string} [name] Azure resource name. + * @member {string} [type] Azure resource type. + * @member {string} [location] Azure resource location. */ -export interface ClientCertificateThumbprint { - isAdmin: boolean; - certificateThumbprint: string; +export interface ProxyResource extends BaseResource { + readonly id?: string; + readonly name?: string; + readonly type?: string; + location?: string; } /** * @class - * Initializes a new instance of the ClusterVersionDetails class. + * Initializes a new instance of the ApplicationResource class. * @constructor - * The detail of the Service Fabric runtime version result + * The application resource. * - * @member {string} [codeVersion] The Service Fabric runtime version of the - * cluster. - * @member {string} [supportExpiryUtc] The date of expiry of support of the - * version. - * @member {string} [environment] Indicates if this version is for Windows or - * Linux operating system. Possible values include: 'Windows', 'Linux' + * @member {string} [typeVersion] The version of the application type as + * defined in the application manifest. + * @member {object} [parameters] List of application parameters with overridden + * values from their default values specified in the application manifest. + * @member {object} [upgradePolicy] Describes the policy for a monitored + * application upgrade. + * @member {number} [upgradePolicy.upgradeReplicaSetCheckTimeout] The maximum + * amount of time to block processing of an upgrade domain and prevent loss of + * availability when there are unexpected issues. When this timeout expires, + * processing of the upgrade domain will proceed regardless of availability + * loss issues. The timeout is reset at the start of each upgrade domain. Valid + * values are between 0 and 42949672925 inclusive. (unsigned 32-bit integer). + * @member {boolean} [upgradePolicy.forceRestart] If true, then processes are + * forcefully restarted during upgrade even when the code version has not + * changed (the upgrade only changes configuration or data). + * @member {object} [upgradePolicy.rollingUpgradeMonitoringPolicy] The policy + * used for monitoring the application upgrade + * @member {string} + * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] The + * amount of time to wait after completing an upgrade domain before applying + * health policies. It is first interpreted as a string representing an ISO + * 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * @member {string} + * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] The + * amount of time that the application or cluster must remain healthy before + * the upgrade proceeds to the next upgrade domain. It is first interpreted as + * a string representing an ISO 8601 duration. If that fails, then it is + * interpreted as a number representing the total number of milliseconds. + * @member {string} + * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] The + * amount of time to retry health evaluation when the application or cluster is + * unhealthy before FailureAction is executed. It is first interpreted as a + * string representing an ISO 8601 duration. If that fails, then it is + * interpreted as a number representing the total number of milliseconds. + * @member {string} + * [upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The amount of + * time the overall upgrade has to complete before FailureAction is executed. + * It is first interpreted as a string representing an ISO 8601 duration. If + * that fails, then it is interpreted as a number representing the total number + * of milliseconds. + * @member {string} + * [upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] The + * amount of time each upgrade domain has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * @member {object} [upgradePolicy.applicationHealthPolicy] Defines a health + * policy used to evaluate the health of an application or one of its children + * entities. + * @member {object} + * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The + * health policy used by default to evaluate the health of a service type. + * @member {number} + * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * @member {object} + * [upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] The map + * with service type health policy per service type name. The map is empty by + * default. + * @member {boolean} + * [upgradePolicy.applicationHealthPolicy.considerWarningAsError] Indicates + * whether warnings are treated with the same severity as errors. + * @member {number} + * [upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * @member {object} + * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] The + * health policy used by default to evaluate the health of a service type. + * @member {number} + * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * @member {object} + * [upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] The map + * with service type health policy per service type name. The map is empty by + * default. + * @member {number} [minimumNodes] The minimum number of nodes where Service + * Fabric will reserve capacity for this application. Note that this does not + * mean that the services of this application will be placed on all of those + * nodes. If this property is set to zero, no capacity will be reserved. The + * value of this property cannot be more than the value of the MaximumNodes + * property. + * @member {number} [maximumNodes] The maximum number of nodes where Service + * Fabric will reserve capacity for this application. Note that this does not + * mean that the services of this application will be placed on all of those + * nodes. By default, the value of this property is zero and it means that the + * services can be placed on any node. Default value: 0 . + * @member {boolean} [removeApplicationCapacity] Remove the current application + * capacity settings. + * @member {array} [metrics] List of application capacity metric description. + * @member {string} [provisioningState] The current deployment or provisioning + * state, which only appears in the response + * @member {string} [typeName] The application type name as defined in the + * application manifest. */ -export interface ClusterVersionDetails { - codeVersion?: string; - supportExpiryUtc?: string; - environment?: string; +export interface ApplicationResource extends ProxyResource { + typeVersion?: string; + parameters?: { [propertyName: string]: string }; + upgradePolicy?: ApplicationUpgradePolicy; + minimumNodes?: number; + maximumNodes?: number; + removeApplicationCapacity?: boolean; + metrics?: ApplicationMetricDescription[]; + readonly provisioningState?: string; + typeName?: string; } /** * @class - * Initializes a new instance of the SettingsParameterDescription class. + * Initializes a new instance of the ApplicationResourceList class. * @constructor - * Describes a parameter in fabric settings of the cluster. + * The list of application resources. * - * @member {string} name The parameter name of fabric setting. - * @member {string} value The parameter value of fabric setting. + * @member {array} [value] */ -export interface SettingsParameterDescription { - name: string; - value: string; +export interface ApplicationResourceList { + value?: ApplicationResource[]; } /** * @class - * Initializes a new instance of the SettingsSectionDescription class. + * Initializes a new instance of the RollingUpgradeMonitoringPolicy class. * @constructor - * Describes a section in the fabric settings of the cluster. + * The policy used for monitoring the application upgrade * - * @member {string} name The section name of the fabric settings. - * @member {array} parameters The collection of parameters in the section. + * @member {string} [healthCheckWaitDuration] The amount of time to wait after + * completing an upgrade domain before applying health policies. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * @member {string} [healthCheckStableDuration] The amount of time that the + * application or cluster must remain healthy before the upgrade proceeds to + * the next upgrade domain. It is first interpreted as a string representing an + * ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * @member {string} [healthCheckRetryTimeout] The amount of time to retry + * health evaluation when the application or cluster is unhealthy before + * FailureAction is executed. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * @member {string} [upgradeTimeout] The amount of time the overall upgrade has + * to complete before FailureAction is executed. It is first interpreted as a + * string representing an ISO 8601 duration. If that fails, then it is + * interpreted as a number representing the total number of milliseconds. + * @member {string} [upgradeDomainTimeout] The amount of time each upgrade + * domain has to complete before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. */ -export interface SettingsSectionDescription { - name: string; - parameters: SettingsParameterDescription[]; +export interface RollingUpgradeMonitoringPolicy { + healthCheckWaitDuration?: string; + healthCheckStableDuration?: string; + healthCheckRetryTimeout?: string; + upgradeTimeout?: string; + upgradeDomainTimeout?: string; } /** * @class - * Initializes a new instance of the EndpointRangeDescription class. + * Initializes a new instance of the ApplicationUpgradePolicy class. * @constructor - * Port range details - * - * @member {number} startPort Starting port of a range of ports - * @member {number} endPort End port of a range of ports + * Describes the policy for a monitored application upgrade. + * + * @member {number} [upgradeReplicaSetCheckTimeout] The maximum amount of time + * to block processing of an upgrade domain and prevent loss of availability + * when there are unexpected issues. When this timeout expires, processing of + * the upgrade domain will proceed regardless of availability loss issues. The + * timeout is reset at the start of each upgrade domain. Valid values are + * between 0 and 42949672925 inclusive. (unsigned 32-bit integer). + * @member {boolean} [forceRestart] If true, then processes are forcefully + * restarted during upgrade even when the code version has not changed (the + * upgrade only changes configuration or data). + * @member {object} [rollingUpgradeMonitoringPolicy] The policy used for + * monitoring the application upgrade + * @member {string} [rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * @member {string} [rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * @member {string} [rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * @member {string} [rollingUpgradeMonitoringPolicy.upgradeTimeout] The amount + * of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * @member {string} [rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] The + * amount of time each upgrade domain has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * @member {object} [applicationHealthPolicy] Defines a health policy used to + * evaluate the health of an application or one of its children entities. + * @member {object} [applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * @member {number} + * [applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * @member {object} [applicationHealthPolicy.serviceTypeHealthPolicies] The map + * with service type health policy per service type name. The map is empty by + * default. + * @member {boolean} [applicationHealthPolicy.considerWarningAsError] Indicates + * whether warnings are treated with the same severity as errors. + * @member {number} + * [applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] The + * maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * @member {object} [applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. + * @member {number} + * [applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * @member {object} [applicationHealthPolicy.serviceTypeHealthPolicyMap] The + * map with service type health policy per service type name. The map is empty + * by default. */ -export interface EndpointRangeDescription { - startPort: number; - endPort: number; +export interface ApplicationUpgradePolicy { + upgradeReplicaSetCheckTimeout?: number; + forceRestart?: boolean; + rollingUpgradeMonitoringPolicy?: RollingUpgradeMonitoringPolicy; + applicationHealthPolicy?: ApplicationHealthPolicy; } /** * @class - * Initializes a new instance of the NodeTypeDescription class. + * Initializes a new instance of the ApplicationResourceUpdate class. * @constructor - * Describes a node type in the cluster, each node type represents sub set of - * nodes in the cluster. + * The application resource for patch operations. * - * @member {string} name The name of the node type. - * @member {object} [placementProperties] The placement tags applied to nodes - * in the node type, which can be used to indicate where certain services - * (workload) should run. - * @member {object} [capacities] The capacity tags applied to the nodes in the - * node type, the cluster resource manager uses these tags to understand how - * much resource a node has. - * @member {number} clientConnectionEndpointPort The TCP cluster management - * endpoint port. - * @member {number} httpGatewayEndpointPort The HTTP cluster management - * endpoint port. - * @member {string} [durabilityLevel] Possible values include: 'Bronze', - * 'Silver', 'Gold' - * @member {object} [applicationPorts] The range of ports from which cluster - * assigned port to Service Fabric applications. - * @member {number} [applicationPorts.startPort] Starting port of a range of - * ports - * @member {number} [applicationPorts.endPort] End port of a range of ports - * @member {object} [ephemeralPorts] The range of empheral ports that nodes in - * this node type should be configured with. - * @member {number} [ephemeralPorts.startPort] Starting port of a range of - * ports - * @member {number} [ephemeralPorts.endPort] End port of a range of ports - * @member {boolean} isPrimary The node type on which system services will run. - * Only one node type should be marked as primary. Primary node type cannot be - * deleted or changed for existing clusters. - * @member {number} vmInstanceCount The number of nodes in the node type. This - * count should match the capacity property in the corresponding - * VirtualMachineScaleSet resource. - * @member {number} [reverseProxyEndpointPort] The endpoint used by reverse - * proxy. + * @member {string} [typeVersion] The version of the application type as + * defined in the application manifest. + * @member {object} [parameters] List of application parameters with overridden + * values from their default values specified in the application manifest. + * @member {object} [upgradePolicy] Describes the policy for a monitored + * application upgrade. + * @member {number} [upgradePolicy.upgradeReplicaSetCheckTimeout] The maximum + * amount of time to block processing of an upgrade domain and prevent loss of + * availability when there are unexpected issues. When this timeout expires, + * processing of the upgrade domain will proceed regardless of availability + * loss issues. The timeout is reset at the start of each upgrade domain. Valid + * values are between 0 and 42949672925 inclusive. (unsigned 32-bit integer). + * @member {boolean} [upgradePolicy.forceRestart] If true, then processes are + * forcefully restarted during upgrade even when the code version has not + * changed (the upgrade only changes configuration or data). + * @member {object} [upgradePolicy.rollingUpgradeMonitoringPolicy] The policy + * used for monitoring the application upgrade + * @member {string} + * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] The + * amount of time to wait after completing an upgrade domain before applying + * health policies. It is first interpreted as a string representing an ISO + * 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * @member {string} + * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] The + * amount of time that the application or cluster must remain healthy before + * the upgrade proceeds to the next upgrade domain. It is first interpreted as + * a string representing an ISO 8601 duration. If that fails, then it is + * interpreted as a number representing the total number of milliseconds. + * @member {string} + * [upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] The + * amount of time to retry health evaluation when the application or cluster is + * unhealthy before FailureAction is executed. It is first interpreted as a + * string representing an ISO 8601 duration. If that fails, then it is + * interpreted as a number representing the total number of milliseconds. + * @member {string} + * [upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The amount of + * time the overall upgrade has to complete before FailureAction is executed. + * It is first interpreted as a string representing an ISO 8601 duration. If + * that fails, then it is interpreted as a number representing the total number + * of milliseconds. + * @member {string} + * [upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] The + * amount of time each upgrade domain has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * @member {object} [upgradePolicy.applicationHealthPolicy] Defines a health + * policy used to evaluate the health of an application or one of its children + * entities. + * @member {object} + * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] The + * health policy used by default to evaluate the health of a service type. + * @member {number} + * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * @member {object} + * [upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] The map + * with service type health policy per service type name. The map is empty by + * default. + * @member {boolean} + * [upgradePolicy.applicationHealthPolicy.considerWarningAsError] Indicates + * whether warnings are treated with the same severity as errors. + * @member {number} + * [upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * @member {object} + * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] The + * health policy used by default to evaluate the health of a service type. + * @member {number} + * [upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * @member {object} + * [upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] The map + * with service type health policy per service type name. The map is empty by + * default. + * @member {number} [minimumNodes] The minimum number of nodes where Service + * Fabric will reserve capacity for this application. Note that this does not + * mean that the services of this application will be placed on all of those + * nodes. If this property is set to zero, no capacity will be reserved. The + * value of this property cannot be more than the value of the MaximumNodes + * property. + * @member {number} [maximumNodes] The maximum number of nodes where Service + * Fabric will reserve capacity for this application. Note that this does not + * mean that the services of this application will be placed on all of those + * nodes. By default, the value of this property is zero and it means that the + * services can be placed on any node. Default value: 0 . + * @member {boolean} [removeApplicationCapacity] Remove the current application + * capacity settings. + * @member {array} [metrics] List of application capacity metric description. */ -export interface NodeTypeDescription { - name: string; - placementProperties?: { [propertyName: string]: string }; - capacities?: { [propertyName: string]: string }; - clientConnectionEndpointPort: number; - httpGatewayEndpointPort: number; - durabilityLevel?: string; - applicationPorts?: EndpointRangeDescription; - ephemeralPorts?: EndpointRangeDescription; - isPrimary: boolean; - vmInstanceCount: number; - reverseProxyEndpointPort?: number; +export interface ApplicationResourceUpdate extends ProxyResource { + typeVersion?: string; + parameters?: { [propertyName: string]: string }; + upgradePolicy?: ApplicationUpgradePolicy; + minimumNodes?: number; + maximumNodes?: number; + removeApplicationCapacity?: boolean; + metrics?: ApplicationMetricDescription[]; } /** * @class - * Initializes a new instance of the DiagnosticsStorageAccountConfig class. + * Initializes a new instance of the ApplicationTypeResource class. * @constructor - * The storage account information for storing Service Fabric diagnostic logs. + * The application type name resource * - * @member {string} storageAccountName The Azure storage account name. - * @member {string} protectedAccountKeyName The protected diagnostics storage - * key name. - * @member {string} blobEndpoint The blob endpoint of the azure storage - * account. - * @member {string} queueEndpoint The queue endpoint of the azure storage - * account. - * @member {string} tableEndpoint The table endpoint of the azure storage - * account. + * @member {string} [provisioningState] The current deployment or provisioning + * state, which only appears in the response. */ -export interface DiagnosticsStorageAccountConfig { - storageAccountName: string; - protectedAccountKeyName: string; - blobEndpoint: string; - queueEndpoint: string; - tableEndpoint: string; +export interface ApplicationTypeResource extends ProxyResource { + readonly provisioningState?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationTypeResourceList class. + * @constructor + * The list of application type names. + * + * @member {array} [value] + */ +export interface ApplicationTypeResourceList { + value?: ApplicationTypeResource[]; } /** * @class - * Initializes a new instance of the ClusterHealthPolicy class. + * Initializes a new instance of the ApplicationTypeVersionResource class. * @constructor - * Defines a health policy used to evaluate the health of the cluster or of a - * cluster node. + * An application type version resource for the specified application type name + * resource. * - * @member {number} [maxPercentUnhealthyNodes] The maximum allowed percentage - * of unhealthy nodes before reporting an error. For example, to allow 10% of - * nodes to be unhealthy, this value would be 10. - * @member {number} [maxPercentUnhealthyApplications] The maximum allowed - * percentage of unhealthy applications before reporting an error. For example, - * to allow 10% of applications to be unhealthy, this value would be 10. + * @member {string} [provisioningState] The current deployment or provisioning + * state, which only appears in the response + * @member {string} appPackageUrl The URL to the application package + * @member {object} [defaultParameterList] List of application type parameters + * that can be overridden when creating or updating the application. */ -export interface ClusterHealthPolicy { - maxPercentUnhealthyNodes?: number; - maxPercentUnhealthyApplications?: number; +export interface ApplicationTypeVersionResource extends ProxyResource { + readonly provisioningState?: string; + appPackageUrl: string; + readonly defaultParameterList?: { [propertyName: string]: string }; } /** * @class - * Initializes a new instance of the ClusterUpgradeDeltaHealthPolicy class. + * Initializes a new instance of the ApplicationTypeVersionResourceList class. * @constructor - * Describes the delta health policies for the cluster upgrade. + * The list of application type version resources for the specified application + * type name resource. * - * @member {number} maxPercentDeltaUnhealthyNodes The maximum allowed - * percentage of nodes health degradation allowed during cluster upgrades. The - * delta is measured between the state of the nodes at the beginning of upgrade - * and the state of the nodes at the time of the health evaluation. The check - * is performed after every upgrade domain upgrade completion to make sure the - * global state of the cluster is within tolerated limits. - * @member {number} maxPercentUpgradeDomainDeltaUnhealthyNodes The maximum - * allowed percentage of upgrade domain nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the upgrade - * domain nodes at the beginning of upgrade and the state of the upgrade domain - * nodes at the time of the health evaluation. The check is performed after - * every upgrade domain upgrade completion for all completed upgrade domains to - * make sure the state of the upgrade domains is within tolerated limits. - * @member {number} maxPercentDeltaUnhealthyApplications The maximum allowed - * percentage of applications health degradation allowed during cluster - * upgrades. The delta is measured between the state of the applications at the - * beginning of upgrade and the state of the applications at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. System services are not included in this. + * @member {array} [value] */ -export interface ClusterUpgradeDeltaHealthPolicy { - maxPercentDeltaUnhealthyNodes: number; - maxPercentUpgradeDomainDeltaUnhealthyNodes: number; - maxPercentDeltaUnhealthyApplications: number; +export interface ApplicationTypeVersionResourceList { + value?: ApplicationTypeVersionResource[]; } /** * @class - * Initializes a new instance of the ClusterUpgradePolicy class. + * Initializes a new instance of the ServiceResourcePropertiesBase class. * @constructor - * Describes the policy used when upgrading the cluster. + * The common service resource properties. * - * @member {boolean} [forceRestart] If true, then processes are forcefully - * restarted during upgrade even when the code version has not changed (the - * upgrade only changes configuration or data). - * @member {string} upgradeReplicaSetCheckTimeout The maximum amount of time to - * block processing of an upgrade domain and revent loss of availability when - * there are unexpected issues. When this timeout expires, processing of the - * upgrade domain will proceed regardless of availability loss issues. The - * timeout is reset at the start of each upgrade domain. The timeout can be in - * either hh:mm:ss or in d.hh:mm:ss.ms format. - * @member {string} healthCheckWaitDuration The length of time to wait after - * completing an upgrade domain before performing health checks. The duration - * can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - * @member {string} healthCheckStableDuration The amount of time that the - * application or cluster must remain healthy before the upgrade proceeds to - * the next upgrade domain. The duration can be in either hh:mm:ss or in - * d.hh:mm:ss.ms format. - * @member {string} healthCheckRetryTimeout The amount of time to retry health - * evaluation when the application or cluster is unhealthy before the upgrade - * rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms - * format. - * @member {string} upgradeTimeout The amount of time the overall upgrade has - * to complete before the upgrade rolls back. The timeout can be in either - * hh:mm:ss or in d.hh:mm:ss.ms format. - * @member {string} upgradeDomainTimeout The amount of time each upgrade domain - * has to complete before the upgrade rolls back. The timeout can be in either - * hh:mm:ss or in d.hh:mm:ss.ms format. - * @member {object} healthPolicy The cluster health policy used when upgrading - * the cluster. - * @member {number} [healthPolicy.maxPercentUnhealthyNodes] The maximum allowed - * percentage of unhealthy nodes before reporting an error. For example, to - * allow 10% of nodes to be unhealthy, this value would be 10. - * @member {number} [healthPolicy.maxPercentUnhealthyApplications] The maximum - * allowed percentage of unhealthy applications before reporting an error. For - * example, to allow 10% of applications to be unhealthy, this value would be - * 10. - * @member {object} [deltaHealthPolicy] The delta health policy used when - * upgrading the cluster. - * @member {number} [deltaHealthPolicy.maxPercentDeltaUnhealthyNodes] The - * maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. - * @member {number} - * [deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes] The maximum - * allowed percentage of upgrade domain nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the upgrade - * domain nodes at the beginning of upgrade and the state of the upgrade domain - * nodes at the time of the health evaluation. The check is performed after - * every upgrade domain upgrade completion for all completed upgrade domains to - * make sure the state of the upgrade domains is within tolerated limits. - * @member {number} [deltaHealthPolicy.maxPercentDeltaUnhealthyApplications] - * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * @member {string} [placementConstraints] The placement constraints as a + * string. Placement constraints are boolean expressions on node properties and + * allow for restricting a service to particular nodes based on the service + * requirements. For example, to place a service on nodes where NodeType is + * blue specify the following: "NodeColor == blue)". + * @member {array} [correlationScheme] A list that describes the correlation of + * the service with other services. + * @member {array} [serviceLoadMetrics] The service load metrics is given as an + * array of ServiceLoadMetricDescription objects. + * @member {array} [servicePlacementPolicies] A list that describes the + * correlation of the service with other services. + * @member {string} [defaultMoveCost] Specifies the move cost for the service. + * Possible values include: 'Zero', 'Low', 'Medium', 'High' */ -export interface ClusterUpgradePolicy { - forceRestart?: boolean; - upgradeReplicaSetCheckTimeout: string; - healthCheckWaitDuration: string; - healthCheckStableDuration: string; - healthCheckRetryTimeout: string; - upgradeTimeout: string; - upgradeDomainTimeout: string; - healthPolicy: ClusterHealthPolicy; - deltaHealthPolicy?: ClusterUpgradeDeltaHealthPolicy; +export interface ServiceResourcePropertiesBase { + placementConstraints?: string; + correlationScheme?: ServiceCorrelationDescription[]; + serviceLoadMetrics?: ServiceLoadMetricDescription[]; + servicePlacementPolicies?: ServicePlacementPolicyDescription[]; + defaultMoveCost?: string; } /** * @class - * Initializes a new instance of the Resource class. + * Initializes a new instance of the ServiceResourceProperties class. * @constructor - * The resource model definition. + * The service resource properties. * - * @member {string} [id] Azure resource ID. - * @member {string} [name] Azure resource name. - * @member {string} [type] Azure resource type. - * @member {string} location Resource location. - * @member {object} [tags] Resource tags. + * @member {string} [provisioningState] The current deployment or provisioning + * state, which only appears in the response + * @member {string} [serviceTypeName] The name of the service type + * @member {object} [partitionDescription] Describes how the service is + * partitioned. + * @member {string} [partitionDescription.partitionScheme] Polymorphic + * Discriminator + * @member {string} serviceKind Polymorphic Discriminator */ -export interface Resource extends BaseResource { - readonly id?: string; - readonly name?: string; - readonly type?: string; - location: string; - tags?: { [propertyName: string]: string }; +export interface ServiceResourceProperties extends ServiceResourcePropertiesBase { + readonly provisioningState?: string; + serviceTypeName?: string; + partitionDescription?: PartitionSchemeDescription; + serviceKind: string; } /** * @class - * Initializes a new instance of the Cluster class. + * Initializes a new instance of the ServiceResource class. * @constructor - * The cluster resource - * + * The service resource. * - * @member {array} [availableClusterVersions] The Service Fabric runtime - * versions available for this cluster. - * @member {string} [clusterId] A service generated unique identifier for the - * cluster resource. - * @member {string} [clusterState] Possible values include: 'WaitingForNodes', - * 'Deploying', 'BaselineUpgrade', 'UpdatingUserConfiguration', - * 'UpdatingUserCertificate', 'UpdatingInfrastructure', - * 'EnforcingClusterVersion', 'UpgradeServiceUnreachable', 'AutoScale', 'Ready' - * @member {string} [clusterEndpoint] The Azure Resource Provider endpoint. A - * system service in the cluster connects to this endpoint. - * @member {string} [clusterCodeVersion] The Service Fabric runtime version of - * the cluster. This property can only by set the user when **upgradeMode** is - * set to 'Manual'. To get list of available Service Fabric versions for new - * clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of - * available version for existing clusters use **availableClusterVersions**. - * @member {object} [certificate] The certificate to use for securing the - * cluster. The certificate provided will be used for node to node security - * within the cluster, SSL certificate for cluster management endpoint and - * default admin client. - * @member {string} [certificate.thumbprint] Thumbprint of the primary - * certificate. - * @member {string} [certificate.thumbprintSecondary] Thumbprint of the - * secondary certificate. - * @member {string} [certificate.x509StoreName] The local certificate store - * location. Possible values include: 'AddressBook', 'AuthRoot', - * 'CertificateAuthority', 'Disallowed', 'My', 'Root', 'TrustedPeople', - * 'TrustedPublisher' - * @member {string} [reliabilityLevel] Possible values include: 'None', - * 'Bronze', 'Silver', 'Gold', 'Platinum' - * @member {string} [upgradeMode] Possible values include: 'Automatic', - * 'Manual' - * @member {array} [clientCertificateThumbprints] The list of client - * certificates referenced by thumbprint that are allowed to manage the - * cluster. - * @member {array} [clientCertificateCommonNames] The list of client - * certificates referenced by common name that are allowed to manage the - * cluster. - * @member {array} [fabricSettings] The list of custom fabric settings to - * configure the cluster. - * @member {object} [reverseProxyCertificate] The server certificate used by - * reverse proxy. - * @member {string} [reverseProxyCertificate.thumbprint] Thumbprint of the - * primary certificate. - * @member {string} [reverseProxyCertificate.thumbprintSecondary] Thumbprint of - * the secondary certificate. - * @member {string} [reverseProxyCertificate.x509StoreName] The local - * certificate store location. Possible values include: 'AddressBook', - * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', - * 'TrustedPeople', 'TrustedPublisher' - * @member {string} managementEndpoint The http management endpoint of the - * cluster. - * @member {array} nodeTypes The list of node types in the cluster. - * @member {object} [azureActiveDirectory] The AAD authentication settings of - * the cluster. - * @member {string} [azureActiveDirectory.tenantId] Azure active directory - * tenant id. - * @member {string} [azureActiveDirectory.clusterApplication] Azure active - * directory cluster application id. - * @member {string} [azureActiveDirectory.clientApplication] Azure active - * directory client application id. - * @member {string} [provisioningState] The provisioning state of the cluster - * resource. Possible values include: 'Updating', 'Succeeded', 'Failed', - * 'Canceled' - * @member {string} [vmImage] The VM image VMSS has been configured with. - * Generic names such as Windows or Linux can be used. - * @member {object} [diagnosticsStorageAccountConfig] The storage account - * information for storing Service Fabric diagnostic logs. - * @member {string} [diagnosticsStorageAccountConfig.storageAccountName] The - * Azure storage account name. - * @member {string} [diagnosticsStorageAccountConfig.protectedAccountKeyName] - * The protected diagnostics storage key name. - * @member {string} [diagnosticsStorageAccountConfig.blobEndpoint] The blob - * endpoint of the azure storage account. - * @member {string} [diagnosticsStorageAccountConfig.queueEndpoint] The queue - * endpoint of the azure storage account. - * @member {string} [diagnosticsStorageAccountConfig.tableEndpoint] The table - * endpoint of the azure storage account. - * @member {object} [upgradeDescription] The policy to use when upgrading the - * cluster. - * @member {boolean} [upgradeDescription.forceRestart] If true, then processes - * are forcefully restarted during upgrade even when the code version has not - * changed (the upgrade only changes configuration or data). - * @member {string} [upgradeDescription.upgradeReplicaSetCheckTimeout] The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of - * availability loss issues. The timeout is reset at the start of each upgrade - * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - * @member {string} [upgradeDescription.healthCheckWaitDuration] The length of - * time to wait after completing an upgrade domain before performing health - * checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - * @member {string} [upgradeDescription.healthCheckStableDuration] The amount - * of time that the application or cluster must remain healthy before the - * upgrade proceeds to the next upgrade domain. The duration can be in either - * hh:mm:ss or in d.hh:mm:ss.ms format. - * @member {string} [upgradeDescription.healthCheckRetryTimeout] The amount of - * time to retry health evaluation when the application or cluster is unhealthy - * before the upgrade rolls back. The timeout can be in either hh:mm:ss or in - * d.hh:mm:ss.ms format. - * @member {string} [upgradeDescription.upgradeTimeout] The amount of time the - * overall upgrade has to complete before the upgrade rolls back. The timeout - * can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - * @member {string} [upgradeDescription.upgradeDomainTimeout] The amount of - * time each upgrade domain has to complete before the upgrade rolls back. The - * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - * @member {object} [upgradeDescription.healthPolicy] The cluster health policy - * used when upgrading the cluster. - * @member {number} [upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] - * The maximum allowed percentage of unhealthy nodes before reporting an error. - * For example, to allow 10% of nodes to be unhealthy, this value would be 10. - * @member {number} - * [upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] The - * maximum allowed percentage of unhealthy applications before reporting an - * error. For example, to allow 10% of applications to be unhealthy, this value - * would be 10. - * @member {object} [upgradeDescription.deltaHealthPolicy] The delta health - * policy used when upgrading the cluster. - * @member {number} - * [upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes] The - * maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. - * @member {number} - * [upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes] - * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. - * @member {number} - * [upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications] - * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. - * @member {array} [addOnFeatures] The list of add-on features to enable in the - * cluster. - */ -export interface Cluster extends Resource { - availableClusterVersions?: ClusterVersionDetails[]; - readonly clusterId?: string; - clusterState?: string; - readonly clusterEndpoint?: string; - clusterCodeVersion?: string; - certificate?: CertificateDescription; - reliabilityLevel?: string; - upgradeMode?: string; - clientCertificateThumbprints?: ClientCertificateThumbprint[]; - clientCertificateCommonNames?: ClientCertificateCommonName[]; - fabricSettings?: SettingsSectionDescription[]; - reverseProxyCertificate?: CertificateDescription; - managementEndpoint: string; - nodeTypes: NodeTypeDescription[]; - azureActiveDirectory?: AzureActiveDirectory; + * @member {string} [placementConstraints] The placement constraints as a + * string. Placement constraints are boolean expressions on node properties and + * allow for restricting a service to particular nodes based on the service + * requirements. For example, to place a service on nodes where NodeType is + * blue specify the following: "NodeColor == blue)". + * @member {array} [correlationScheme] A list that describes the correlation of + * the service with other services. + * @member {array} [serviceLoadMetrics] The service load metrics is given as an + * array of ServiceLoadMetricDescription objects. + * @member {array} [servicePlacementPolicies] A list that describes the + * correlation of the service with other services. + * @member {string} [defaultMoveCost] Specifies the move cost for the service. + * Possible values include: 'Zero', 'Low', 'Medium', 'High' + * @member {string} [provisioningState] The current deployment or provisioning + * state, which only appears in the response + * @member {string} [serviceTypeName] The name of the service type + * @member {object} [partitionDescription] Describes how the service is + * partitioned. + * @member {string} [partitionDescription.partitionScheme] Polymorphic + * Discriminator + * @member {string} serviceKind Polymorphic Discriminator + */ +export interface ServiceResource extends ProxyResource { + placementConstraints?: string; + correlationScheme?: ServiceCorrelationDescription[]; + serviceLoadMetrics?: ServiceLoadMetricDescription[]; + servicePlacementPolicies?: ServicePlacementPolicyDescription[]; + defaultMoveCost?: string; readonly provisioningState?: string; - vmImage?: string; - diagnosticsStorageAccountConfig?: DiagnosticsStorageAccountConfig; - upgradeDescription?: ClusterUpgradePolicy; - addOnFeatures?: string[]; + serviceTypeName?: string; + partitionDescription?: PartitionSchemeDescription; + serviceKind: string; } /** * @class - * Initializes a new instance of the ClusterCodeVersionsResult class. + * Initializes a new instance of the ServiceResourceList class. * @constructor - * The result of the ServiceFabric runtime versions + * The list of service resources. * - * @member {string} [id] The identification of the result - * @member {string} [name] The name of the result - * @member {string} [type] The result resource type - * @member {string} [codeVersion] The Service Fabric runtime version of the - * cluster. - * @member {string} [supportExpiryUtc] The date of expiry of support of the - * version. - * @member {string} [environment] Indicates if this version is for Windows or - * Linux operating system. Possible values include: 'Windows', 'Linux' + * @member {array} [value] */ -export interface ClusterCodeVersionsResult { - id?: string; - name?: string; - type?: string; - codeVersion?: string; - supportExpiryUtc?: string; - environment?: string; +export interface ServiceResourceList { + value?: ServiceResource[]; } /** * @class - * Initializes a new instance of the ClusterCodeVersionsListResult class. + * Initializes a new instance of the ServiceResourceUpdateProperties class. * @constructor - * The list results of the ServiceFabric runtime versions. + * The service resource properties for patch operations. * - * @member {array} [value] - * @member {string} [nextLink] The URL to use for getting the next set of - * results. + * @member {string} serviceKind Polymorphic Discriminator */ -export interface ClusterCodeVersionsListResult { - value?: ClusterCodeVersionsResult[]; - nextLink?: string; +export interface ServiceResourceUpdateProperties extends ServiceResourcePropertiesBase { + serviceKind: string; } /** * @class - * Initializes a new instance of the ClusterListResult class. + * Initializes a new instance of the ServiceResourceUpdate class. * @constructor - * Cluster list results + * The service resource for patch operations. * - * @member {array} [value] - * @member {string} [nextLink] The URL to use for getting the next set of - * results. + * @member {string} [placementConstraints] The placement constraints as a + * string. Placement constraints are boolean expressions on node properties and + * allow for restricting a service to particular nodes based on the service + * requirements. For example, to place a service on nodes where NodeType is + * blue specify the following: "NodeColor == blue)". + * @member {array} [correlationScheme] A list that describes the correlation of + * the service with other services. + * @member {array} [serviceLoadMetrics] The service load metrics is given as an + * array of ServiceLoadMetricDescription objects. + * @member {array} [servicePlacementPolicies] A list that describes the + * correlation of the service with other services. + * @member {string} [defaultMoveCost] Specifies the move cost for the service. + * Possible values include: 'Zero', 'Low', 'Medium', 'High' + * @member {string} serviceKind Polymorphic Discriminator */ -export interface ClusterListResult { - value?: Cluster[]; - nextLink?: string; +export interface ServiceResourceUpdate extends ProxyResource { + placementConstraints?: string; + correlationScheme?: ServiceCorrelationDescription[]; + serviceLoadMetrics?: ServiceLoadMetricDescription[]; + servicePlacementPolicies?: ServicePlacementPolicyDescription[]; + defaultMoveCost?: string; + serviceKind: string; } /** * @class - * Initializes a new instance of the ClusterUpdateParameters class. + * Initializes a new instance of the StatefulServiceProperties class. * @constructor - * Cluster update request + * The properties of a stateful service resource. * - * @member {string} [reliabilityLevel] The reliability level sets the replica - * set size of system services. Learn about - * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). - * Possible values include: 'Bronze', 'Silver', 'Gold' - * @member {string} [upgradeMode] The upgrade mode of the cluster. This - * indicates if the cluster should be automatically upgraded when new Service - * Fabric runtime version is available. Possible values include: 'Automatic', - * 'Manual' - * @member {string} [clusterCodeVersion] The Service Fabric runtime version of - * the cluster. This property can only by set the user when **upgradeMode** is - * set to 'Manual'. To get list of available Service Fabric versions for new - * clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of - * available version for existing clusters use **availableClusterVersions**. - * @member {object} [certificate] The certificate to use for securing the - * cluster. The certificate provided will be used for node to node security - * within the cluster, SSL certificate for cluster management endpoint and - * default admin client. - * @member {string} [certificate.thumbprint] Thumbprint of the primary - * certificate. - * @member {string} [certificate.thumbprintSecondary] Thumbprint of the - * secondary certificate. - * @member {string} [certificate.x509StoreName] The local certificate store - * location. Possible values include: 'AddressBook', 'AuthRoot', - * 'CertificateAuthority', 'Disallowed', 'My', 'Root', 'TrustedPeople', - * 'TrustedPublisher' - * @member {array} [clientCertificateThumbprints] The list of client - * certificates referenced by thumbprint that are allowed to manage the - * cluster. This will overwrite the existing list. - * @member {array} [clientCertificateCommonNames] The list of client - * certificates referenced by common name that are allowed to manage the - * cluster. This will overwrite the existing list. - * @member {array} [fabricSettings] The list of custom fabric settings to - * configure the cluster. This will overwrite the existing list. - * @member {object} [reverseProxyCertificate] The server certificate used by - * reverse proxy. - * @member {string} [reverseProxyCertificate.thumbprint] Thumbprint of the - * primary certificate. - * @member {string} [reverseProxyCertificate.thumbprintSecondary] Thumbprint of - * the secondary certificate. - * @member {string} [reverseProxyCertificate.x509StoreName] The local - * certificate store location. Possible values include: 'AddressBook', - * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', - * 'TrustedPeople', 'TrustedPublisher' - * @member {array} [nodeTypes] The list of node types in the cluster. This will - * overwrite the existing list. - * @member {object} [upgradeDescription] The policy to use when upgrading the - * cluster. - * @member {boolean} [upgradeDescription.forceRestart] If true, then processes - * are forcefully restarted during upgrade even when the code version has not - * changed (the upgrade only changes configuration or data). - * @member {string} [upgradeDescription.upgradeReplicaSetCheckTimeout] The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of - * availability loss issues. The timeout is reset at the start of each upgrade - * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - * @member {string} [upgradeDescription.healthCheckWaitDuration] The length of - * time to wait after completing an upgrade domain before performing health - * checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - * @member {string} [upgradeDescription.healthCheckStableDuration] The amount - * of time that the application or cluster must remain healthy before the - * upgrade proceeds to the next upgrade domain. The duration can be in either - * hh:mm:ss or in d.hh:mm:ss.ms format. - * @member {string} [upgradeDescription.healthCheckRetryTimeout] The amount of - * time to retry health evaluation when the application or cluster is unhealthy - * before the upgrade rolls back. The timeout can be in either hh:mm:ss or in - * d.hh:mm:ss.ms format. - * @member {string} [upgradeDescription.upgradeTimeout] The amount of time the - * overall upgrade has to complete before the upgrade rolls back. The timeout - * can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - * @member {string} [upgradeDescription.upgradeDomainTimeout] The amount of - * time each upgrade domain has to complete before the upgrade rolls back. The - * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - * @member {object} [upgradeDescription.healthPolicy] The cluster health policy - * used when upgrading the cluster. - * @member {number} [upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] - * The maximum allowed percentage of unhealthy nodes before reporting an error. - * For example, to allow 10% of nodes to be unhealthy, this value would be 10. - * @member {number} - * [upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] The - * maximum allowed percentage of unhealthy applications before reporting an - * error. For example, to allow 10% of applications to be unhealthy, this value - * would be 10. - * @member {object} [upgradeDescription.deltaHealthPolicy] The delta health - * policy used when upgrading the cluster. - * @member {number} - * [upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes] The - * maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. - * @member {number} - * [upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes] - * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. - * @member {number} - * [upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications] - * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. - * @member {array} [addOnFeatures] The list of add-on features to enable in the - * cluster. - * @member {object} [tags] Cluster update parameters + * @member {boolean} [hasPersistedState] A flag indicating whether this is a + * persistent service which stores states on the local disk. If it is then the + * value of this property is true, if not it is false. + * @member {number} [targetReplicaSetSize] The target replica set size as a + * number. + * @member {number} [minReplicaSetSize] The minimum replica set size as a + * number. + * @member {date} [replicaRestartWaitDuration] The duration between when a + * replica goes down and when a new replica is created, represented in ISO 8601 + * format (hh:mm:ss.s). + * @member {date} [quorumLossWaitDuration] The maximum duration for which a + * partition is allowed to be in a state of quorum loss, represented in ISO + * 8601 format (hh:mm:ss.s). + * @member {date} [standByReplicaKeepDuration] The definition on how long + * StandBy replicas should be maintained before being removed, represented in + * ISO 8601 format (hh:mm:ss.s). */ -export interface ClusterUpdateParameters { - reliabilityLevel?: string; - upgradeMode?: string; - clusterCodeVersion?: string; - certificate?: CertificateDescription; - clientCertificateThumbprints?: ClientCertificateThumbprint[]; - clientCertificateCommonNames?: ClientCertificateCommonName[]; - fabricSettings?: SettingsSectionDescription[]; - reverseProxyCertificate?: CertificateDescription; - nodeTypes?: NodeTypeDescription[]; - upgradeDescription?: ClusterUpgradePolicy; - addOnFeatures?: string[]; - tags?: { [propertyName: string]: string }; +export interface StatefulServiceProperties extends ServiceResourceProperties { + hasPersistedState?: boolean; + targetReplicaSetSize?: number; + minReplicaSetSize?: number; + replicaRestartWaitDuration?: Date; + quorumLossWaitDuration?: Date; + standByReplicaKeepDuration?: Date; } /** * @class - * Initializes a new instance of the ErrorModel class. + * Initializes a new instance of the StatefulServiceUpdateProperties class. * @constructor - * The error details. + * The properties of a stateful service resource for patch operations. * - * @member {string} [code] The error code. - * @member {string} [message] The error message. + * @member {number} [targetReplicaSetSize] The target replica set size as a + * number. + * @member {number} [minReplicaSetSize] The minimum replica set size as a + * number. + * @member {date} [replicaRestartWaitDuration] The duration between when a + * replica goes down and when a new replica is created, represented in ISO 8601 + * format (hh:mm:ss.s). + * @member {date} [quorumLossWaitDuration] The maximum duration for which a + * partition is allowed to be in a state of quorum loss, represented in ISO + * 8601 format (hh:mm:ss.s). + * @member {date} [standByReplicaKeepDuration] The definition on how long + * StandBy replicas should be maintained before being removed, represented in + * ISO 8601 format (hh:mm:ss.s). */ -export interface ErrorModel { - code?: string; - message?: string; +export interface StatefulServiceUpdateProperties extends ServiceResourceUpdateProperties { + targetReplicaSetSize?: number; + minReplicaSetSize?: number; + replicaRestartWaitDuration?: Date; + quorumLossWaitDuration?: Date; + standByReplicaKeepDuration?: Date; } /** * @class - * Initializes a new instance of the OperationResult class. + * Initializes a new instance of the StatelessServiceProperties class. * @constructor - * Available operation list result + * The properties of a stateless service resource. * - * @member {string} [name] The name of the operation. - * @member {object} [display] The object that represents the operation. - * @member {string} [display.provider] The name of the provider. - * @member {string} [display.resource] The resource on which the operation is - * performed - * @member {string} [display.operation] The operation that can be performed. - * @member {string} [display.description] Operation description - * @member {string} [origin] Origin result - * @member {string} [nextLink] The URL to use for getting the next set of - * results. + * @member {number} [instanceCount] The instance count. */ -export interface OperationResult { - name?: string; - display?: AvailableOperationDisplay; - origin?: string; - nextLink?: string; +export interface StatelessServiceProperties extends ServiceResourceProperties { + instanceCount?: number; } /** * @class - * Initializes a new instance of the ServiceTypeDeltaHealthPolicy class. + * Initializes a new instance of the StatelessServiceUpdateProperties class. * @constructor - * Service health policy - * + * The properties of a stateless service resource for patch operations. * - * @member {number} [maxPercentDeltaUnhealthyServices] Maximum percentage of - * unhealthy services in cluster + * @member {number} [instanceCount] The instance count. */ -export interface ServiceTypeDeltaHealthPolicy { - maxPercentDeltaUnhealthyServices?: number; +export interface StatelessServiceUpdateProperties extends ServiceResourceUpdateProperties { + instanceCount?: number; } diff --git a/lib/services/serviceFabricManagement/lib/models/index.js b/lib/services/serviceFabricManagement/lib/models/index.js index c3672107b0..0475cc0a85 100644 --- a/lib/services/serviceFabricManagement/lib/models/index.js +++ b/lib/services/serviceFabricManagement/lib/models/index.js @@ -18,49 +18,23 @@ var msRestAzure = require('ms-rest-azure'); exports.BaseResource = msRestAzure.BaseResource; exports.CloudError = msRestAzure.CloudError; +exports.ServiceTypeDeltaHealthPolicy = require('./serviceTypeDeltaHealthPolicy'); +exports.ApplicationDeltaHealthPolicy = require('./applicationDeltaHealthPolicy'); exports.ServiceTypeHealthPolicy = require('./serviceTypeHealthPolicy'); -exports.ServiceTypeHealthPolicyMapItem = require('./serviceTypeHealthPolicyMapItem'); exports.ApplicationHealthPolicy = require('./applicationHealthPolicy'); -exports.ApplicationMetricDescription = require('./applicationMetricDescription'); -exports.ApplicationParameter = require('./applicationParameter'); -exports.ServiceCorrelationDescription = require('./serviceCorrelationDescription'); -exports.ServiceLoadMetricDescription = require('./serviceLoadMetricDescription'); -exports.ServicePlacementPolicyDescription = require('./servicePlacementPolicyDescription'); -exports.PartitionSchemeDescription = require('./partitionSchemeDescription'); -exports.NamedPartitionSchemeDescription = require('./namedPartitionSchemeDescription'); -exports.SingletonPartitionSchemeDescription = require('./singletonPartitionSchemeDescription'); -exports.UniformInt64RangePartitionSchemeDescription = require('./uniformInt64RangePartitionSchemeDescription'); -exports.ProxyResource = require('./proxyResource'); -exports.ApplicationTypeResource = require('./applicationTypeResource'); -exports.ApplicationTypeResourceList = require('./applicationTypeResourceList'); -exports.VersionResource = require('./versionResource'); -exports.VersionResourceList = require('./versionResourceList'); -exports.ApplicationResource = require('./applicationResource'); -exports.ApplicationResourceList = require('./applicationResourceList'); -exports.RollingUpgradeMonitoringPolicy = require('./rollingUpgradeMonitoringPolicy'); -exports.ApplicationUpgradePolicy = require('./applicationUpgradePolicy'); -exports.ApplicationResourceUpdate = require('./applicationResourceUpdate'); -exports.ServicePropertiesBase = require('./servicePropertiesBase'); -exports.ServiceProperties = require('./serviceProperties'); -exports.ServiceResource = require('./serviceResource'); -exports.ServiceResourceList = require('./serviceResourceList'); -exports.ServiceUpdateProperties = require('./serviceUpdateProperties'); -exports.ServiceResourceUpdate = require('./serviceResourceUpdate'); -exports.StatelessService = require('./statelessService'); -exports.StatelessServiceUpdate = require('./statelessServiceUpdate'); -exports.StatefulService = require('./statefulService'); -exports.StatefulServiceUpdate = require('./statefulServiceUpdate'); exports.AvailableOperationDisplay = require('./availableOperationDisplay'); exports.AzureActiveDirectory = require('./azureActiveDirectory'); exports.CertificateDescription = require('./certificateDescription'); exports.ClientCertificateCommonName = require('./clientCertificateCommonName'); exports.ClientCertificateThumbprint = require('./clientCertificateThumbprint'); exports.ClusterVersionDetails = require('./clusterVersionDetails'); +exports.ServerCertificateCommonName = require('./serverCertificateCommonName'); +exports.ServerCertificateCommonNames = require('./serverCertificateCommonNames'); +exports.DiagnosticsStorageAccountConfig = require('./diagnosticsStorageAccountConfig'); exports.SettingsParameterDescription = require('./settingsParameterDescription'); exports.SettingsSectionDescription = require('./settingsSectionDescription'); exports.EndpointRangeDescription = require('./endpointRangeDescription'); exports.NodeTypeDescription = require('./nodeTypeDescription'); -exports.DiagnosticsStorageAccountConfig = require('./diagnosticsStorageAccountConfig'); exports.ClusterHealthPolicy = require('./clusterHealthPolicy'); exports.ClusterUpgradeDeltaHealthPolicy = require('./clusterUpgradeDeltaHealthPolicy'); exports.ClusterUpgradePolicy = require('./clusterUpgradePolicy'); @@ -70,9 +44,37 @@ exports.ClusterCodeVersionsResult = require('./clusterCodeVersionsResult'); exports.ClusterCodeVersionsListResult = require('./clusterCodeVersionsListResult'); exports.ClusterListResult = require('./clusterListResult'); exports.ClusterUpdateParameters = require('./clusterUpdateParameters'); -exports.ErrorModel = require('./errorModel'); exports.OperationResult = require('./operationResult'); -exports.ServiceTypeDeltaHealthPolicy = require('./serviceTypeDeltaHealthPolicy'); +exports.ErrorModelError = require('./errorModelError'); +exports.ErrorModel = require('./errorModel'); +exports.ApplicationMetricDescription = require('./applicationMetricDescription'); +exports.ServiceCorrelationDescription = require('./serviceCorrelationDescription'); +exports.ServiceLoadMetricDescription = require('./serviceLoadMetricDescription'); +exports.ServicePlacementPolicyDescription = require('./servicePlacementPolicyDescription'); +exports.PartitionSchemeDescription = require('./partitionSchemeDescription'); +exports.NamedPartitionSchemeDescription = require('./namedPartitionSchemeDescription'); +exports.SingletonPartitionSchemeDescription = require('./singletonPartitionSchemeDescription'); +exports.UniformInt64RangePartitionSchemeDescription = require('./uniformInt64RangePartitionSchemeDescription'); +exports.ProxyResource = require('./proxyResource'); +exports.ApplicationResource = require('./applicationResource'); +exports.ApplicationResourceList = require('./applicationResourceList'); +exports.RollingUpgradeMonitoringPolicy = require('./rollingUpgradeMonitoringPolicy'); +exports.ApplicationUpgradePolicy = require('./applicationUpgradePolicy'); +exports.ApplicationResourceUpdate = require('./applicationResourceUpdate'); +exports.ApplicationTypeResource = require('./applicationTypeResource'); +exports.ApplicationTypeResourceList = require('./applicationTypeResourceList'); +exports.ApplicationTypeVersionResource = require('./applicationTypeVersionResource'); +exports.ApplicationTypeVersionResourceList = require('./applicationTypeVersionResourceList'); +exports.ServiceResourcePropertiesBase = require('./serviceResourcePropertiesBase'); +exports.ServiceResourceProperties = require('./serviceResourceProperties'); +exports.ServiceResource = require('./serviceResource'); +exports.ServiceResourceList = require('./serviceResourceList'); +exports.ServiceResourceUpdateProperties = require('./serviceResourceUpdateProperties'); +exports.ServiceResourceUpdate = require('./serviceResourceUpdate'); +exports.StatefulServiceProperties = require('./statefulServiceProperties'); +exports.StatefulServiceUpdateProperties = require('./statefulServiceUpdateProperties'); +exports.StatelessServiceProperties = require('./statelessServiceProperties'); +exports.StatelessServiceUpdateProperties = require('./statelessServiceUpdateProperties'); exports.OperationListResult = require('./operationListResult'); exports.discriminators = { 'ServicePlacementPolicyDescription' : exports.ServicePlacementPolicyDescription, @@ -80,10 +82,10 @@ exports.discriminators = { 'PartitionSchemeDescription.Named' : exports.NamedPartitionSchemeDescription, 'PartitionSchemeDescription.Singleton' : exports.SingletonPartitionSchemeDescription, 'PartitionSchemeDescription.UniformInt64Range' : exports.UniformInt64RangePartitionSchemeDescription, - 'ServicePropertiesBase.ServiceProperties' : exports.ServiceProperties, - 'ServicePropertiesBase.ServiceUpdateProperties' : exports.ServiceUpdateProperties, - 'ServicePropertiesBase.StatelessService' : exports.StatelessService, - 'ServicePropertiesBase.StatelessServiceUpdate' : exports.StatelessServiceUpdate, - 'ServicePropertiesBase.StatefulService' : exports.StatefulService, - 'ServicePropertiesBase.StatefulServiceUpdate' : exports.StatefulServiceUpdate + 'ServiceResourcePropertiesBase.ServiceResourceProperties' : exports.ServiceResourceProperties, + 'ServiceResourcePropertiesBase.ServiceResourceUpdateProperties' : exports.ServiceResourceUpdateProperties, + 'ServiceResourcePropertiesBase.Stateful' : exports.StatefulServiceProperties, + 'ServiceResourcePropertiesBase.Stateful' : exports.StatefulServiceUpdateProperties, + 'ServiceResourcePropertiesBase.Stateless' : exports.StatelessServiceProperties, + 'ServiceResourcePropertiesBase.Stateless' : exports.StatelessServiceUpdateProperties }; diff --git a/lib/services/serviceFabricManagement/lib/models/namedPartitionSchemeDescription.js b/lib/services/serviceFabricManagement/lib/models/namedPartitionSchemeDescription.js index 4ae3accf80..d6966a7a3a 100644 --- a/lib/services/serviceFabricManagement/lib/models/namedPartitionSchemeDescription.js +++ b/lib/services/serviceFabricManagement/lib/models/namedPartitionSchemeDescription.js @@ -40,11 +40,17 @@ class NamedPartitionSchemeDescription extends models['PartitionSchemeDescription serializedName: 'Named', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'PartitionScheme', + clientName: 'partitionScheme' + }, + uberParent: 'PartitionSchemeDescription', className: 'NamedPartitionSchemeDescription', modelProperties: { partitionScheme: { required: true, serializedName: 'PartitionScheme', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabricManagement/lib/models/nodeTypeDescription.js b/lib/services/serviceFabricManagement/lib/models/nodeTypeDescription.js index e6ecadcf4a..e04f7f907c 100644 --- a/lib/services/serviceFabricManagement/lib/models/nodeTypeDescription.js +++ b/lib/services/serviceFabricManagement/lib/models/nodeTypeDescription.js @@ -31,8 +31,17 @@ class NodeTypeDescription { * endpoint port. * @member {number} httpGatewayEndpointPort The HTTP cluster management * endpoint port. - * @member {string} [durabilityLevel] Possible values include: 'Bronze', - * 'Silver', 'Gold' + * @member {string} [durabilityLevel] The durability level of the node type. + * Learn about + * [DurabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + * + * - Bronze - No privileges. This is the default. + * - Silver - The infrastructure jobs can be paused for a duration of 10 + * minutes per UD. + * - Gold - The infrastructure jobs can be paused for a duration of 2 hours + * per UD. Gold durability can be enabled only on full node VM skus like + * D15_V2, G5 etc. + * . Possible values include: 'Bronze', 'Silver', 'Gold' * @member {object} [applicationPorts] The range of ports from which cluster * assigned port to Service Fabric applications. * @member {number} [applicationPorts.startPort] Starting port of a range of diff --git a/lib/services/serviceFabricManagement/lib/models/partitionSchemeDescription.js b/lib/services/serviceFabricManagement/lib/models/partitionSchemeDescription.js index 012b278aad..a4f278c3d0 100644 --- a/lib/services/serviceFabricManagement/lib/models/partitionSchemeDescription.js +++ b/lib/services/serviceFabricManagement/lib/models/partitionSchemeDescription.js @@ -44,6 +44,7 @@ class PartitionSchemeDescription { partitionScheme: { required: true, serializedName: 'PartitionScheme', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabricManagement/lib/models/proxyResource.js b/lib/services/serviceFabricManagement/lib/models/proxyResource.js index 7c8e7ffd93..704b3dfff8 100644 --- a/lib/services/serviceFabricManagement/lib/models/proxyResource.js +++ b/lib/services/serviceFabricManagement/lib/models/proxyResource.js @@ -13,17 +13,17 @@ const models = require('./index'); /** - * The resource model definition. + * The resource model definition for proxy-only resource. * * @extends models['BaseResource'] */ class ProxyResource extends models['BaseResource'] { /** * Create a ProxyResource. - * @member {string} [id] Azure resource ID. + * @member {string} [id] Azure resource identifier. * @member {string} [name] Azure resource name. * @member {string} [type] Azure resource type. - * @member {string} location Resource location. + * @member {string} [location] Azure resource location. */ constructor() { super(); @@ -68,7 +68,7 @@ class ProxyResource extends models['BaseResource'] { } }, location: { - required: true, + required: false, serializedName: 'location', type: { name: 'String' diff --git a/lib/services/serviceFabricManagement/lib/models/resource.js b/lib/services/serviceFabricManagement/lib/models/resource.js index 98d9f6094b..0dbb3d039f 100644 --- a/lib/services/serviceFabricManagement/lib/models/resource.js +++ b/lib/services/serviceFabricManagement/lib/models/resource.js @@ -20,11 +20,11 @@ const models = require('./index'); class Resource extends models['BaseResource'] { /** * Create a Resource. - * @member {string} [id] Azure resource ID. + * @member {string} [id] Azure resource identifier. * @member {string} [name] Azure resource name. * @member {string} [type] Azure resource type. - * @member {string} location Resource location. - * @member {object} [tags] Resource tags. + * @member {string} location Azure resource location. + * @member {object} [tags] Azure resource tags. */ constructor() { super(); diff --git a/lib/services/serviceFabricManagement/lib/models/rollingUpgradeMonitoringPolicy.js b/lib/services/serviceFabricManagement/lib/models/rollingUpgradeMonitoringPolicy.js index 3f3602c77b..eb668d33e8 100644 --- a/lib/services/serviceFabricManagement/lib/models/rollingUpgradeMonitoringPolicy.js +++ b/lib/services/serviceFabricManagement/lib/models/rollingUpgradeMonitoringPolicy.js @@ -17,11 +17,30 @@ class RollingUpgradeMonitoringPolicy { /** * Create a RollingUpgradeMonitoringPolicy. - * @member {string} [healthCheckWaitDuration] - * @member {string} [healthCheckStableDuration] - * @member {string} [healthCheckRetryTimeout] - * @member {string} [upgradeTimeout] - * @member {string} [upgradeDomainTimeout] + * @member {string} [healthCheckWaitDuration] The amount of time to wait + * after completing an upgrade domain before applying health policies. It is + * first interpreted as a string representing an ISO 8601 duration. If that + * fails, then it is interpreted as a number representing the total number of + * milliseconds. + * @member {string} [healthCheckStableDuration] The amount of time that the + * application or cluster must remain healthy before the upgrade proceeds to + * the next upgrade domain. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * @member {string} [healthCheckRetryTimeout] The amount of time to retry + * health evaluation when the application or cluster is unhealthy before + * FailureAction is executed. It is first interpreted as a string + * representing an ISO 8601 duration. If that fails, then it is interpreted + * as a number representing the total number of milliseconds. + * @member {string} [upgradeTimeout] The amount of time the overall upgrade + * has to complete before FailureAction is executed. It is first interpreted + * as a string representing an ISO 8601 duration. If that fails, then it is + * interpreted as a number representing the total number of milliseconds. + * @member {string} [upgradeDomainTimeout] The amount of time each upgrade + * domain has to complete before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. */ constructor() { } diff --git a/lib/services/serviceFabricManagement/lib/models/serverCertificateCommonName.js b/lib/services/serviceFabricManagement/lib/models/serverCertificateCommonName.js new file mode 100644 index 0000000000..ccc0f70ca7 --- /dev/null +++ b/lib/services/serviceFabricManagement/lib/models/serverCertificateCommonName.js @@ -0,0 +1,62 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Describes the server certificate details using common name. + * + */ +class ServerCertificateCommonName { + /** + * Create a ServerCertificateCommonName. + * @member {string} certificateCommonName The common name of the server + * certificate. + * @member {string} certificateIssuerThumbprint The issuer thumbprint of the + * server certificate. + */ + constructor() { + } + + /** + * Defines the metadata of ServerCertificateCommonName + * + * @returns {object} metadata of ServerCertificateCommonName + * + */ + mapper() { + return { + required: false, + serializedName: 'ServerCertificateCommonName', + type: { + name: 'Composite', + className: 'ServerCertificateCommonName', + modelProperties: { + certificateCommonName: { + required: true, + serializedName: 'certificateCommonName', + type: { + name: 'String' + } + }, + certificateIssuerThumbprint: { + required: true, + serializedName: 'certificateIssuerThumbprint', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServerCertificateCommonName; diff --git a/lib/services/serviceFabricManagement/lib/models/serverCertificateCommonNames.js b/lib/services/serviceFabricManagement/lib/models/serverCertificateCommonNames.js new file mode 100644 index 0000000000..a203cbda11 --- /dev/null +++ b/lib/services/serviceFabricManagement/lib/models/serverCertificateCommonNames.js @@ -0,0 +1,75 @@ +/* + * 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'); + +/** + * Describes a list of server certificates referenced by common name that are + * used to secure the cluster. + * + */ +class ServerCertificateCommonNames { + /** + * Create a ServerCertificateCommonNames. + * @member {array} [commonNames] The list of server certificates referenced + * by common name that are used to secure the cluster. + * @member {string} [x509StoreName] The local certificate store location. + * Possible values include: 'AddressBook', 'AuthRoot', + * 'CertificateAuthority', 'Disallowed', 'My', 'Root', 'TrustedPeople', + * 'TrustedPublisher' + */ + constructor() { + } + + /** + * Defines the metadata of ServerCertificateCommonNames + * + * @returns {object} metadata of ServerCertificateCommonNames + * + */ + mapper() { + return { + required: false, + serializedName: 'ServerCertificateCommonNames', + type: { + name: 'Composite', + className: 'ServerCertificateCommonNames', + modelProperties: { + commonNames: { + required: false, + serializedName: 'commonNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServerCertificateCommonNameElementType', + type: { + name: 'Composite', + className: 'ServerCertificateCommonName' + } + } + } + }, + x509StoreName: { + required: false, + serializedName: 'x509StoreName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServerCertificateCommonNames; diff --git a/lib/services/serviceFabricManagement/lib/models/serviceCorrelationDescription.js b/lib/services/serviceFabricManagement/lib/models/serviceCorrelationDescription.js index 8b408ff009..007b505183 100644 --- a/lib/services/serviceFabricManagement/lib/models/serviceCorrelationDescription.js +++ b/lib/services/serviceFabricManagement/lib/models/serviceCorrelationDescription.js @@ -17,9 +17,12 @@ class ServiceCorrelationDescription { /** * Create a ServiceCorrelationDescription. - * @member {string} scheme Possible values include: 'Invalid', 'Affinity', + * @member {string} scheme The ServiceCorrelationScheme which describes the + * relationship between this service and the service specified via + * ServiceName. Possible values include: 'Invalid', 'Affinity', * 'AlignedAffinity', 'NonAlignedAffinity' - * @member {string} serviceName + * @member {string} serviceName The name of the service that the correlation + * relationship is established with. */ constructor() { } diff --git a/lib/services/serviceFabricManagement/lib/models/serviceLoadMetricDescription.js b/lib/services/serviceFabricManagement/lib/models/serviceLoadMetricDescription.js index 2c561a1273..71ec3a7f97 100644 --- a/lib/services/serviceFabricManagement/lib/models/serviceLoadMetricDescription.js +++ b/lib/services/serviceFabricManagement/lib/models/serviceLoadMetricDescription.js @@ -21,8 +21,9 @@ class ServiceLoadMetricDescription { * report load during runtime, the load metric name should match the name * that is specified in Name exactly. Note that metric names are case * sensitive. - * @member {string} [weight] Possible values include: 'Zero', 'Low', - * 'Medium', 'High' + * @member {string} [weight] The service load metric relative weight, + * compared to other metrics configured for this service, as a number. + * Possible values include: 'Zero', 'Low', 'Medium', 'High' * @member {number} [primaryDefaultLoad] Used only for Stateful services. The * default amount of load, as a number, that this service creates for this * metric when it is a Primary replica. diff --git a/lib/services/serviceFabricManagement/lib/models/servicePlacementPolicyDescription.js b/lib/services/serviceFabricManagement/lib/models/servicePlacementPolicyDescription.js index f4fba2ebeb..9ba27f8952 100644 --- a/lib/services/serviceFabricManagement/lib/models/servicePlacementPolicyDescription.js +++ b/lib/services/serviceFabricManagement/lib/models/servicePlacementPolicyDescription.js @@ -44,6 +44,7 @@ class ServicePlacementPolicyDescription { type: { required: true, serializedName: 'Type', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabricManagement/lib/models/serviceResource.js b/lib/services/serviceFabricManagement/lib/models/serviceResource.js index eea2a7cc56..a0af10bffd 100644 --- a/lib/services/serviceFabricManagement/lib/models/serviceResource.js +++ b/lib/services/serviceFabricManagement/lib/models/serviceResource.js @@ -25,20 +25,22 @@ class ServiceResource extends models['ProxyResource'] { * and allow for restricting a service to particular nodes based on the * service requirements. For example, to place a service on nodes where * NodeType is blue specify the following: "NodeColor == blue)". - * @member {array} [correlationScheme] - * @member {array} [serviceLoadMetrics] - * @member {array} [servicePlacementPolicies] - * @member {string} [defaultMoveCost] Possible values include: 'Zero', 'Low', - * 'Medium', 'High' + * @member {array} [correlationScheme] A list that describes the correlation + * of the service with other services. + * @member {array} [serviceLoadMetrics] The service load metrics is given as + * an array of ServiceLoadMetricDescription objects. + * @member {array} [servicePlacementPolicies] A list that describes the + * correlation of the service with other services. + * @member {string} [defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' * @member {string} [provisioningState] The current deployment or * provisioning state, which only appears in the response - * @member {string} [serviceKind] Possible values include: 'Invalid', - * 'Stateless', 'Stateful' * @member {string} [serviceTypeName] The name of the service type - * @member {object} [partitionDescription] + * @member {object} [partitionDescription] Describes how the service is + * partitioned. * @member {string} [partitionDescription.partitionScheme] Polymorphic * Discriminator - * @member {string} serviceResourceType Polymorphic Discriminator + * @member {string} serviceKind Polymorphic Discriminator */ constructor() { super(); @@ -83,7 +85,7 @@ class ServiceResource extends models['ProxyResource'] { } }, location: { - required: true, + required: false, serializedName: 'location', type: { name: 'String' @@ -161,13 +163,6 @@ class ServiceResource extends models['ProxyResource'] { name: 'String' } }, - serviceKind: { - required: false, - serializedName: 'properties.serviceKind', - type: { - name: 'String' - } - }, serviceTypeName: { required: false, serializedName: 'properties.serviceTypeName', @@ -188,9 +183,9 @@ class ServiceResource extends models['ProxyResource'] { className: 'PartitionSchemeDescription' } }, - serviceResourceType: { + serviceKind: { required: true, - serializedName: 'properties.serviceResourceType', + serializedName: 'properties.serviceKind', type: { name: 'String' } diff --git a/lib/services/serviceFabricManagement/lib/models/serviceResourceProperties.js b/lib/services/serviceFabricManagement/lib/models/serviceResourceProperties.js new file mode 100644 index 0000000000..372dfa5ad9 --- /dev/null +++ b/lib/services/serviceFabricManagement/lib/models/serviceResourceProperties.js @@ -0,0 +1,161 @@ +/* + * 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 service resource properties. + * + * @extends models['ServiceResourcePropertiesBase'] + */ +class ServiceResourceProperties extends models['ServiceResourcePropertiesBase'] { + /** + * Create a ServiceResourceProperties. + * @member {string} [provisioningState] The current deployment or + * provisioning state, which only appears in the response + * @member {string} [serviceTypeName] The name of the service type + * @member {object} [partitionDescription] Describes how the service is + * partitioned. + * @member {string} [partitionDescription.partitionScheme] Polymorphic + * Discriminator + * @member {string} serviceKind Polymorphic Discriminator + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServiceResourceProperties + * + * @returns {object} metadata of ServiceResourceProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceResourceProperties', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'serviceKind', + clientName: 'serviceKind' + }, + uberParent: 'ServiceResourcePropertiesBase', + className: 'ServiceResourceProperties', + modelProperties: { + placementConstraints: { + required: false, + serializedName: 'placementConstraints', + type: { + name: 'String' + } + }, + correlationScheme: { + required: false, + serializedName: 'correlationScheme', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceCorrelationDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceCorrelationDescription' + } + } + } + }, + serviceLoadMetrics: { + required: false, + serializedName: 'serviceLoadMetrics', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceLoadMetricDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceLoadMetricDescription' + } + } + } + }, + servicePlacementPolicies: { + required: false, + serializedName: 'servicePlacementPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServicePlacementPolicyDescriptionElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Type', + clientName: 'type' + }, + uberParent: 'ServicePlacementPolicyDescription', + className: 'ServicePlacementPolicyDescription' + } + } + } + }, + defaultMoveCost: { + required: false, + serializedName: 'defaultMoveCost', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'provisioningState', + type: { + name: 'String' + } + }, + serviceTypeName: { + required: false, + serializedName: 'serviceTypeName', + type: { + name: 'String' + } + }, + partitionDescription: { + required: false, + serializedName: 'partitionDescription', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'PartitionScheme', + clientName: 'partitionScheme' + }, + uberParent: 'PartitionSchemeDescription', + className: 'PartitionSchemeDescription' + } + }, + serviceKind: { + required: true, + serializedName: 'serviceKind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceResourceProperties; diff --git a/lib/services/serviceFabricManagement/lib/models/serviceResourcePropertiesBase.js b/lib/services/serviceFabricManagement/lib/models/serviceResourcePropertiesBase.js new file mode 100644 index 0000000000..0d07764e27 --- /dev/null +++ b/lib/services/serviceFabricManagement/lib/models/serviceResourcePropertiesBase.js @@ -0,0 +1,123 @@ +/* + * 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 common service resource properties. + * + */ +class ServiceResourcePropertiesBase { + /** + * Create a ServiceResourcePropertiesBase. + * @member {string} [placementConstraints] The placement constraints as a + * string. Placement constraints are boolean expressions on node properties + * and allow for restricting a service to particular nodes based on the + * service requirements. For example, to place a service on nodes where + * NodeType is blue specify the following: "NodeColor == blue)". + * @member {array} [correlationScheme] A list that describes the correlation + * of the service with other services. + * @member {array} [serviceLoadMetrics] The service load metrics is given as + * an array of ServiceLoadMetricDescription objects. + * @member {array} [servicePlacementPolicies] A list that describes the + * correlation of the service with other services. + * @member {string} [defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + */ + constructor() { + } + + /** + * Defines the metadata of ServiceResourcePropertiesBase + * + * @returns {object} metadata of ServiceResourcePropertiesBase + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceResourcePropertiesBase', + type: { + name: 'Composite', + className: 'ServiceResourcePropertiesBase', + modelProperties: { + placementConstraints: { + required: false, + serializedName: 'placementConstraints', + type: { + name: 'String' + } + }, + correlationScheme: { + required: false, + serializedName: 'correlationScheme', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceCorrelationDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceCorrelationDescription' + } + } + } + }, + serviceLoadMetrics: { + required: false, + serializedName: 'serviceLoadMetrics', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceLoadMetricDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceLoadMetricDescription' + } + } + } + }, + servicePlacementPolicies: { + required: false, + serializedName: 'servicePlacementPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServicePlacementPolicyDescriptionElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Type', + clientName: 'type' + }, + uberParent: 'ServicePlacementPolicyDescription', + className: 'ServicePlacementPolicyDescription' + } + } + } + }, + defaultMoveCost: { + required: false, + serializedName: 'defaultMoveCost', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceResourcePropertiesBase; diff --git a/lib/services/serviceFabricManagement/lib/models/serviceResourceUpdate.js b/lib/services/serviceFabricManagement/lib/models/serviceResourceUpdate.js index a8cbd9777b..5114d05c1a 100644 --- a/lib/services/serviceFabricManagement/lib/models/serviceResourceUpdate.js +++ b/lib/services/serviceFabricManagement/lib/models/serviceResourceUpdate.js @@ -25,12 +25,15 @@ class ServiceResourceUpdate extends models['ProxyResource'] { * and allow for restricting a service to particular nodes based on the * service requirements. For example, to place a service on nodes where * NodeType is blue specify the following: "NodeColor == blue)". - * @member {array} [correlationScheme] - * @member {array} [serviceLoadMetrics] - * @member {array} [servicePlacementPolicies] - * @member {string} [defaultMoveCost] Possible values include: 'Zero', 'Low', - * 'Medium', 'High' - * @member {string} serviceResourceType Polymorphic Discriminator + * @member {array} [correlationScheme] A list that describes the correlation + * of the service with other services. + * @member {array} [serviceLoadMetrics] The service load metrics is given as + * an array of ServiceLoadMetricDescription objects. + * @member {array} [servicePlacementPolicies] A list that describes the + * correlation of the service with other services. + * @member {string} [defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * @member {string} serviceKind Polymorphic Discriminator */ constructor() { super(); @@ -75,7 +78,7 @@ class ServiceResourceUpdate extends models['ProxyResource'] { } }, location: { - required: true, + required: false, serializedName: 'location', type: { name: 'String' @@ -145,9 +148,9 @@ class ServiceResourceUpdate extends models['ProxyResource'] { name: 'String' } }, - serviceResourceType: { + serviceKind: { required: true, - serializedName: 'properties.serviceResourceType', + serializedName: 'properties.serviceKind', type: { name: 'String' } diff --git a/lib/services/serviceFabricManagement/lib/models/serviceResourceUpdateProperties.js b/lib/services/serviceFabricManagement/lib/models/serviceResourceUpdateProperties.js new file mode 100644 index 0000000000..006a970335 --- /dev/null +++ b/lib/services/serviceFabricManagement/lib/models/serviceResourceUpdateProperties.js @@ -0,0 +1,126 @@ +/* + * 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 service resource properties for patch operations. + * + * @extends models['ServiceResourcePropertiesBase'] + */ +class ServiceResourceUpdateProperties extends models['ServiceResourcePropertiesBase'] { + /** + * Create a ServiceResourceUpdateProperties. + * @member {string} serviceKind Polymorphic Discriminator + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ServiceResourceUpdateProperties + * + * @returns {object} metadata of ServiceResourceUpdateProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceResourceUpdateProperties', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'serviceKind', + clientName: 'serviceKind' + }, + uberParent: 'ServiceResourcePropertiesBase', + className: 'ServiceResourceUpdateProperties', + modelProperties: { + placementConstraints: { + required: false, + serializedName: 'placementConstraints', + type: { + name: 'String' + } + }, + correlationScheme: { + required: false, + serializedName: 'correlationScheme', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceCorrelationDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceCorrelationDescription' + } + } + } + }, + serviceLoadMetrics: { + required: false, + serializedName: 'serviceLoadMetrics', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceLoadMetricDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceLoadMetricDescription' + } + } + } + }, + servicePlacementPolicies: { + required: false, + serializedName: 'servicePlacementPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServicePlacementPolicyDescriptionElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Type', + clientName: 'type' + }, + uberParent: 'ServicePlacementPolicyDescription', + className: 'ServicePlacementPolicyDescription' + } + } + } + }, + defaultMoveCost: { + required: false, + serializedName: 'defaultMoveCost', + type: { + name: 'String' + } + }, + serviceKind: { + required: true, + serializedName: 'serviceKind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ServiceResourceUpdateProperties; diff --git a/lib/services/serviceFabricManagement/lib/models/serviceTypeDeltaHealthPolicy.js b/lib/services/serviceFabricManagement/lib/models/serviceTypeDeltaHealthPolicy.js index b1b4b5cca5..7b6c1df438 100644 --- a/lib/services/serviceFabricManagement/lib/models/serviceTypeDeltaHealthPolicy.js +++ b/lib/services/serviceFabricManagement/lib/models/serviceTypeDeltaHealthPolicy.js @@ -11,15 +11,22 @@ 'use strict'; /** - * Service health policy + * Represents the delta health policy used to evaluate the health of services + * belonging to a service type when upgrading the cluster. * * */ class ServiceTypeDeltaHealthPolicy { /** * Create a ServiceTypeDeltaHealthPolicy. - * @member {number} [maxPercentDeltaUnhealthyServices] Maximum percentage of - * unhealthy services in cluster + * @member {number} [maxPercentDeltaUnhealthyServices] The maximum allowed + * percentage of services health degradation allowed during cluster upgrades. + * The delta is measured between the state of the services at the beginning + * of upgrade and the state of the services at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to + * make sure the global state of the cluster is within tolerated limits. + * . Default value: 0 . */ constructor() { } @@ -41,6 +48,7 @@ class ServiceTypeDeltaHealthPolicy { maxPercentDeltaUnhealthyServices: { required: false, serializedName: 'maxPercentDeltaUnhealthyServices', + defaultValue: 0, constraints: { InclusiveMaximum: 100, InclusiveMinimum: 0 diff --git a/lib/services/serviceFabricManagement/lib/models/serviceTypeHealthPolicy.js b/lib/services/serviceFabricManagement/lib/models/serviceTypeHealthPolicy.js index d648a4398a..812c8d0984 100644 --- a/lib/services/serviceFabricManagement/lib/models/serviceTypeHealthPolicy.js +++ b/lib/services/serviceFabricManagement/lib/models/serviceTypeHealthPolicy.js @@ -19,45 +19,9 @@ class ServiceTypeHealthPolicy { /** * Create a ServiceTypeHealthPolicy. - * @member {number} [maxPercentUnhealthyPartitionsPerService] The maximum - * allowed percentage of unhealthy partitions per service. Allowed values are - * Byte values from zero to 100 - * - * The percentage represents the maximum tolerated percentage of partitions - * that can be unhealthy before the service is considered in error. - * If the percentage is respected but there is at least one unhealthy - * partition, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy - * partitions over the total number of partitions in the service. - * The computation rounds up to tolerate one failure on small numbers of - * partitions. Default percentage is zero. - * . Default value: 0 . - * @member {number} [maxPercentUnhealthyReplicasPerPartition] The maximum - * allowed percentage of unhealthy replicas per partition. Allowed values are - * Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of replicas - * that can be unhealthy before the partition is considered in error. - * If the percentage is respected but there is at least one unhealthy - * replica, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy replicas - * over the total number of replicas in the partition. - * The computation rounds up to tolerate one failure on small numbers of - * replicas. Default percentage is zero. - * . Default value: 0 . - * @member {number} [maxPercentUnhealthyServices] The maximum maximum allowed - * percentage of unhealthy services. Allowed values are Byte values from zero - * to 100. - * - * The percentage represents the maximum tolerated percentage of services - * that can be unhealthy before the application is considered in error. - * If the percentage is respected but there is at least one unhealthy - * service, the health is evaluated as Warning. - * This is calculated by dividing the number of unhealthy services of the - * specific service type over the total number of services of the specific - * service type. - * The computation rounds up to tolerate one failure on small numbers of - * services. Default percentage is zero. + * @member {number} [maxPercentUnhealthyServices] The maximum percentage of + * services allowed to be unhealthy before your application is considered in + * error. * . Default value: 0 . */ constructor() { @@ -77,26 +41,14 @@ class ServiceTypeHealthPolicy { name: 'Composite', className: 'ServiceTypeHealthPolicy', modelProperties: { - maxPercentUnhealthyPartitionsPerService: { - required: false, - serializedName: 'MaxPercentUnhealthyPartitionsPerService', - defaultValue: 0, - type: { - name: 'Number' - } - }, - maxPercentUnhealthyReplicasPerPartition: { - required: false, - serializedName: 'MaxPercentUnhealthyReplicasPerPartition', - defaultValue: 0, - type: { - name: 'Number' - } - }, maxPercentUnhealthyServices: { required: false, - serializedName: 'MaxPercentUnhealthyServices', + serializedName: 'maxPercentUnhealthyServices', defaultValue: 0, + constraints: { + InclusiveMaximum: 100, + InclusiveMinimum: 0 + }, type: { name: 'Number' } diff --git a/lib/services/serviceFabricManagement/lib/models/singletonPartitionSchemeDescription.js b/lib/services/serviceFabricManagement/lib/models/singletonPartitionSchemeDescription.js index fe7bf2ef28..0a78a78081 100644 --- a/lib/services/serviceFabricManagement/lib/models/singletonPartitionSchemeDescription.js +++ b/lib/services/serviceFabricManagement/lib/models/singletonPartitionSchemeDescription.js @@ -38,11 +38,17 @@ class SingletonPartitionSchemeDescription extends models['PartitionSchemeDescrip serializedName: 'Singleton', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'PartitionScheme', + clientName: 'partitionScheme' + }, + uberParent: 'PartitionSchemeDescription', className: 'SingletonPartitionSchemeDescription', modelProperties: { partitionScheme: { required: true, serializedName: 'PartitionScheme', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabricManagement/lib/models/statefulServiceProperties.js b/lib/services/serviceFabricManagement/lib/models/statefulServiceProperties.js new file mode 100644 index 0000000000..78c58a8b2d --- /dev/null +++ b/lib/services/serviceFabricManagement/lib/models/statefulServiceProperties.js @@ -0,0 +1,217 @@ +/* + * 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 properties of a stateful service resource. + * + * @extends models['ServiceResourceProperties'] + */ +class StatefulServiceProperties extends models['ServiceResourceProperties'] { + /** + * Create a StatefulServiceProperties. + * @member {boolean} [hasPersistedState] A flag indicating whether this is a + * persistent service which stores states on the local disk. If it is then + * the value of this property is true, if not it is false. + * @member {number} [targetReplicaSetSize] The target replica set size as a + * number. + * @member {number} [minReplicaSetSize] The minimum replica set size as a + * number. + * @member {date} [replicaRestartWaitDuration] The duration between when a + * replica goes down and when a new replica is created, represented in ISO + * 8601 format (hh:mm:ss.s). + * @member {date} [quorumLossWaitDuration] The maximum duration for which a + * partition is allowed to be in a state of quorum loss, represented in ISO + * 8601 format (hh:mm:ss.s). + * @member {date} [standByReplicaKeepDuration] The definition on how long + * StandBy replicas should be maintained before being removed, represented in + * ISO 8601 format (hh:mm:ss.s). + */ + constructor() { + super(); + } + + /** + * Defines the metadata of StatefulServiceProperties + * + * @returns {object} metadata of StatefulServiceProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'Stateful', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'serviceKind', + clientName: 'serviceKind' + }, + uberParent: 'ServiceResourcePropertiesBase', + className: 'StatefulServiceProperties', + modelProperties: { + placementConstraints: { + required: false, + serializedName: 'placementConstraints', + type: { + name: 'String' + } + }, + correlationScheme: { + required: false, + serializedName: 'correlationScheme', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceCorrelationDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceCorrelationDescription' + } + } + } + }, + serviceLoadMetrics: { + required: false, + serializedName: 'serviceLoadMetrics', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceLoadMetricDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceLoadMetricDescription' + } + } + } + }, + servicePlacementPolicies: { + required: false, + serializedName: 'servicePlacementPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServicePlacementPolicyDescriptionElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Type', + clientName: 'type' + }, + uberParent: 'ServicePlacementPolicyDescription', + className: 'ServicePlacementPolicyDescription' + } + } + } + }, + defaultMoveCost: { + required: false, + serializedName: 'defaultMoveCost', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'provisioningState', + type: { + name: 'String' + } + }, + serviceTypeName: { + required: false, + serializedName: 'serviceTypeName', + type: { + name: 'String' + } + }, + partitionDescription: { + required: false, + serializedName: 'partitionDescription', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'PartitionScheme', + clientName: 'partitionScheme' + }, + uberParent: 'PartitionSchemeDescription', + className: 'PartitionSchemeDescription' + } + }, + serviceKind: { + required: true, + serializedName: 'serviceKind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + hasPersistedState: { + required: false, + serializedName: 'hasPersistedState', + type: { + name: 'Boolean' + } + }, + targetReplicaSetSize: { + required: false, + serializedName: 'targetReplicaSetSize', + constraints: { + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + minReplicaSetSize: { + required: false, + serializedName: 'minReplicaSetSize', + constraints: { + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + replicaRestartWaitDuration: { + required: false, + serializedName: 'replicaRestartWaitDuration', + type: { + name: 'DateTime' + } + }, + quorumLossWaitDuration: { + required: false, + serializedName: 'quorumLossWaitDuration', + type: { + name: 'DateTime' + } + }, + standByReplicaKeepDuration: { + required: false, + serializedName: 'standByReplicaKeepDuration', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = StatefulServiceProperties; diff --git a/lib/services/serviceFabricManagement/lib/models/statefulServiceUpdateProperties.js b/lib/services/serviceFabricManagement/lib/models/statefulServiceUpdateProperties.js new file mode 100644 index 0000000000..547662ccb5 --- /dev/null +++ b/lib/services/serviceFabricManagement/lib/models/statefulServiceUpdateProperties.js @@ -0,0 +1,179 @@ +/* + * 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 properties of a stateful service resource for patch operations. + * + * @extends models['ServiceResourceUpdateProperties'] + */ +class StatefulServiceUpdateProperties extends models['ServiceResourceUpdateProperties'] { + /** + * Create a StatefulServiceUpdateProperties. + * @member {number} [targetReplicaSetSize] The target replica set size as a + * number. + * @member {number} [minReplicaSetSize] The minimum replica set size as a + * number. + * @member {date} [replicaRestartWaitDuration] The duration between when a + * replica goes down and when a new replica is created, represented in ISO + * 8601 format (hh:mm:ss.s). + * @member {date} [quorumLossWaitDuration] The maximum duration for which a + * partition is allowed to be in a state of quorum loss, represented in ISO + * 8601 format (hh:mm:ss.s). + * @member {date} [standByReplicaKeepDuration] The definition on how long + * StandBy replicas should be maintained before being removed, represented in + * ISO 8601 format (hh:mm:ss.s). + */ + constructor() { + super(); + } + + /** + * Defines the metadata of StatefulServiceUpdateProperties + * + * @returns {object} metadata of StatefulServiceUpdateProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'Stateful', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'serviceKind', + clientName: 'serviceKind' + }, + uberParent: 'ServiceResourcePropertiesBase', + className: 'StatefulServiceUpdateProperties', + modelProperties: { + placementConstraints: { + required: false, + serializedName: 'placementConstraints', + type: { + name: 'String' + } + }, + correlationScheme: { + required: false, + serializedName: 'correlationScheme', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceCorrelationDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceCorrelationDescription' + } + } + } + }, + serviceLoadMetrics: { + required: false, + serializedName: 'serviceLoadMetrics', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceLoadMetricDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceLoadMetricDescription' + } + } + } + }, + servicePlacementPolicies: { + required: false, + serializedName: 'servicePlacementPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServicePlacementPolicyDescriptionElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Type', + clientName: 'type' + }, + uberParent: 'ServicePlacementPolicyDescription', + className: 'ServicePlacementPolicyDescription' + } + } + } + }, + defaultMoveCost: { + required: false, + serializedName: 'defaultMoveCost', + type: { + name: 'String' + } + }, + serviceKind: { + required: true, + serializedName: 'serviceKind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + targetReplicaSetSize: { + required: false, + serializedName: 'targetReplicaSetSize', + constraints: { + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + minReplicaSetSize: { + required: false, + serializedName: 'minReplicaSetSize', + constraints: { + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + replicaRestartWaitDuration: { + required: false, + serializedName: 'replicaRestartWaitDuration', + type: { + name: 'DateTime' + } + }, + quorumLossWaitDuration: { + required: false, + serializedName: 'quorumLossWaitDuration', + type: { + name: 'DateTime' + } + }, + standByReplicaKeepDuration: { + required: false, + serializedName: 'standByReplicaKeepDuration', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = StatefulServiceUpdateProperties; diff --git a/lib/services/serviceFabricManagement/lib/models/statelessServiceProperties.js b/lib/services/serviceFabricManagement/lib/models/statelessServiceProperties.js new file mode 100644 index 0000000000..7a8d4fb24d --- /dev/null +++ b/lib/services/serviceFabricManagement/lib/models/statelessServiceProperties.js @@ -0,0 +1,164 @@ +/* + * 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 properties of a stateless service resource. + * + * @extends models['ServiceResourceProperties'] + */ +class StatelessServiceProperties extends models['ServiceResourceProperties'] { + /** + * Create a StatelessServiceProperties. + * @member {number} [instanceCount] The instance count. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of StatelessServiceProperties + * + * @returns {object} metadata of StatelessServiceProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'Stateless', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'serviceKind', + clientName: 'serviceKind' + }, + uberParent: 'ServiceResourcePropertiesBase', + className: 'StatelessServiceProperties', + modelProperties: { + placementConstraints: { + required: false, + serializedName: 'placementConstraints', + type: { + name: 'String' + } + }, + correlationScheme: { + required: false, + serializedName: 'correlationScheme', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceCorrelationDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceCorrelationDescription' + } + } + } + }, + serviceLoadMetrics: { + required: false, + serializedName: 'serviceLoadMetrics', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceLoadMetricDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceLoadMetricDescription' + } + } + } + }, + servicePlacementPolicies: { + required: false, + serializedName: 'servicePlacementPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServicePlacementPolicyDescriptionElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Type', + clientName: 'type' + }, + uberParent: 'ServicePlacementPolicyDescription', + className: 'ServicePlacementPolicyDescription' + } + } + } + }, + defaultMoveCost: { + required: false, + serializedName: 'defaultMoveCost', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'provisioningState', + type: { + name: 'String' + } + }, + serviceTypeName: { + required: false, + serializedName: 'serviceTypeName', + type: { + name: 'String' + } + }, + partitionDescription: { + required: false, + serializedName: 'partitionDescription', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'PartitionScheme', + clientName: 'partitionScheme' + }, + uberParent: 'PartitionSchemeDescription', + className: 'PartitionSchemeDescription' + } + }, + serviceKind: { + required: true, + serializedName: 'serviceKind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + instanceCount: { + required: false, + serializedName: 'instanceCount', + constraints: { + InclusiveMinimum: -1 + }, + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = StatelessServiceProperties; diff --git a/lib/services/serviceFabricManagement/lib/models/statelessServiceUpdateProperties.js b/lib/services/serviceFabricManagement/lib/models/statelessServiceUpdateProperties.js new file mode 100644 index 0000000000..b66a192854 --- /dev/null +++ b/lib/services/serviceFabricManagement/lib/models/statelessServiceUpdateProperties.js @@ -0,0 +1,136 @@ +/* + * 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 properties of a stateless service resource for patch operations. + * + * @extends models['ServiceResourceUpdateProperties'] + */ +class StatelessServiceUpdateProperties extends models['ServiceResourceUpdateProperties'] { + /** + * Create a StatelessServiceUpdateProperties. + * @member {number} [instanceCount] The instance count. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of StatelessServiceUpdateProperties + * + * @returns {object} metadata of StatelessServiceUpdateProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'Stateless', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'serviceKind', + clientName: 'serviceKind' + }, + uberParent: 'ServiceResourcePropertiesBase', + className: 'StatelessServiceUpdateProperties', + modelProperties: { + placementConstraints: { + required: false, + serializedName: 'placementConstraints', + type: { + name: 'String' + } + }, + correlationScheme: { + required: false, + serializedName: 'correlationScheme', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceCorrelationDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceCorrelationDescription' + } + } + } + }, + serviceLoadMetrics: { + required: false, + serializedName: 'serviceLoadMetrics', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServiceLoadMetricDescriptionElementType', + type: { + name: 'Composite', + className: 'ServiceLoadMetricDescription' + } + } + } + }, + servicePlacementPolicies: { + required: false, + serializedName: 'servicePlacementPolicies', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ServicePlacementPolicyDescriptionElementType', + type: { + name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'Type', + clientName: 'type' + }, + uberParent: 'ServicePlacementPolicyDescription', + className: 'ServicePlacementPolicyDescription' + } + } + } + }, + defaultMoveCost: { + required: false, + serializedName: 'defaultMoveCost', + type: { + name: 'String' + } + }, + serviceKind: { + required: true, + serializedName: 'serviceKind', + isPolymorphicDiscriminator: true, + type: { + name: 'String' + } + }, + instanceCount: { + required: false, + serializedName: 'instanceCount', + constraints: { + InclusiveMinimum: -1 + }, + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = StatelessServiceUpdateProperties; diff --git a/lib/services/serviceFabricManagement/lib/models/uniformInt64RangePartitionSchemeDescription.js b/lib/services/serviceFabricManagement/lib/models/uniformInt64RangePartitionSchemeDescription.js index 68a8b65bd2..0fea7502e1 100644 --- a/lib/services/serviceFabricManagement/lib/models/uniformInt64RangePartitionSchemeDescription.js +++ b/lib/services/serviceFabricManagement/lib/models/uniformInt64RangePartitionSchemeDescription.js @@ -45,11 +45,17 @@ class UniformInt64RangePartitionSchemeDescription extends models['PartitionSchem serializedName: 'UniformInt64Range', type: { name: 'Composite', + polymorphicDiscriminator: { + serializedName: 'PartitionScheme', + clientName: 'partitionScheme' + }, + uberParent: 'PartitionSchemeDescription', className: 'UniformInt64RangePartitionSchemeDescription', modelProperties: { partitionScheme: { required: true, serializedName: 'PartitionScheme', + isPolymorphicDiscriminator: true, type: { name: 'String' } diff --git a/lib/services/serviceFabricManagement/lib/operations/applicationTypeVersions.js b/lib/services/serviceFabricManagement/lib/operations/applicationTypeVersions.js new file mode 100644 index 0000000000..b6eb5091de --- /dev/null +++ b/lib/services/serviceFabricManagement/lib/operations/applicationTypeVersions.js @@ -0,0 +1,1487 @@ +/* + * 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; + +/** + * @summary Gets a Service Fabric application type version resource. + * + * Get a Service Fabric application type version resource created or in the + * process of being created in the Service Fabric application type name + * resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {string} version The application type version. + * + * @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 ApplicationTypeVersionResource} 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, clusterName, applicationTypeName, version, 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 apiVersion = '2017-07-01-preview'; + // 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 (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (applicationTypeName === null || applicationTypeName === undefined || typeof applicationTypeName.valueOf() !== 'string') { + throw new Error('applicationTypeName cannot be null or undefined and it must be of type string.'); + } + if (version === null || version === undefined || typeof version.valueOf() !== 'string') { + throw new Error('version 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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{applicationTypeName}', encodeURIComponent(applicationTypeName)); + requestUrl = requestUrl.replace('{version}', encodeURIComponent(version)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ApplicationTypeVersionResource']().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); + }); +} + + +/** + * @summary Creates or updates a Service Fabric application type version + * resource. + * + * Create or update a Service Fabric application type version resource with the + * specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {string} version The application type version. + * + * @param {object} parameters The application type version resource. + * + * @param {string} parameters.appPackageUrl The URL to the application package + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 ApplicationTypeVersionResource} 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 _create(resourceGroupName, clusterName, applicationTypeName, version, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreate(resourceGroupName, clusterName, applicationTypeName, version, parameters, 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['ApplicationTypeVersionResource']().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); + }); + }); +} + + +/** + * @summary Deletes a Service Fabric application type version resource. + * + * Delete a Service Fabric application type version resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {string} version The application type version. + * + * @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, clusterName, applicationTypeName, version, 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(resourceGroupName, clusterName, applicationTypeName, version, 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); + }); + }); +} + +/** + * @summary Gets the list of application type version resources created in the + * specified Service Fabric application type name resource. + * + * Gets all application type version resources created or in the process of + * being created in the Service Fabric application type name resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @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 ApplicationTypeVersionResourceList} 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(resourceGroupName, clusterName, applicationTypeName, 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 apiVersion = '2017-07-01-preview'; + // 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 (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (applicationTypeName === null || applicationTypeName === undefined || typeof applicationTypeName.valueOf() !== 'string') { + throw new Error('applicationTypeName 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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{applicationTypeName}', encodeURIComponent(applicationTypeName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ApplicationTypeVersionResourceList']().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); + }); +} + +/** + * @summary Creates or updates a Service Fabric application type version + * resource. + * + * Create or update a Service Fabric application type version resource with the + * specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {string} version The application type version. + * + * @param {object} parameters The application type version resource. + * + * @param {string} parameters.appPackageUrl The URL to the application package + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 ApplicationTypeVersionResource} 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 _beginCreate(resourceGroupName, clusterName, applicationTypeName, version, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-07-01-preview'; + // 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 (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (applicationTypeName === null || applicationTypeName === undefined || typeof applicationTypeName.valueOf() !== 'string') { + throw new Error('applicationTypeName cannot be null or undefined and it must be of type string.'); + } + if (version === null || version === undefined || typeof version.valueOf() !== 'string') { + throw new Error('version cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{applicationTypeName}', encodeURIComponent(applicationTypeName)); + requestUrl = requestUrl.replace('{version}', encodeURIComponent(version)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ApplicationTypeVersionResource']().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 !== 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 === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplicationTypeVersionResource']().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); + }); +} + +/** + * @summary Deletes a Service Fabric application type version resource. + * + * Delete a Service Fabric application type version resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {string} version The application type version. + * + * @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(resourceGroupName, clusterName, applicationTypeName, version, 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 apiVersion = '2017-07-01-preview'; + // 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 (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (applicationTypeName === null || applicationTypeName === undefined || typeof applicationTypeName.valueOf() !== 'string') { + throw new Error('applicationTypeName cannot be null or undefined and it must be of type string.'); + } + if (version === null || version === undefined || typeof version.valueOf() !== 'string') { + throw new Error('version 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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{applicationTypeName}', encodeURIComponent(applicationTypeName)); + requestUrl = requestUrl.replace('{version}', encodeURIComponent(version)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 ApplicationTypeVersions. */ +class ApplicationTypeVersions { + /** + * Create a ApplicationTypeVersions. + * @param {ServiceFabricManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._create = _create; + this._deleteMethod = _deleteMethod; + this._list = _list; + this._beginCreate = _beginCreate; + this._beginDeleteMethod = _beginDeleteMethod; + } + + /** + * @summary Gets a Service Fabric application type version resource. + * + * Get a Service Fabric application type version resource created or in the + * process of being created in the Service Fabric application type name + * resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {string} version The application type version. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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, clusterName, applicationTypeName, version, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, clusterName, applicationTypeName, version, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a Service Fabric application type version resource. + * + * Get a Service Fabric application type version resource created or in the + * process of being created in the Service Fabric application type name + * resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {string} version The application type version. + * + * @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 {ApplicationTypeVersionResource} - 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 ApplicationTypeVersionResource} 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, clusterName, applicationTypeName, version, 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, clusterName, applicationTypeName, version, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, clusterName, applicationTypeName, version, options, optionalCallback); + } + } + + /** + * @summary Creates or updates a Service Fabric application type version + * resource. + * + * Create or update a Service Fabric application type version resource with the + * specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {string} version The application type version. + * + * @param {object} parameters The application type version resource. + * + * @param {string} parameters.appPackageUrl The URL to the application package + * + * @param {string} [parameters.location] Azure resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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. + */ + createWithHttpOperationResponse(resourceGroupName, clusterName, applicationTypeName, version, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(resourceGroupName, clusterName, applicationTypeName, version, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a Service Fabric application type version + * resource. + * + * Create or update a Service Fabric application type version resource with the + * specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {string} version The application type version. + * + * @param {object} parameters The application type version resource. + * + * @param {string} parameters.appPackageUrl The URL to the application package + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 {ApplicationTypeVersionResource} - 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 ApplicationTypeVersionResource} 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. + */ + create(resourceGroupName, clusterName, applicationTypeName, version, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._create(resourceGroupName, clusterName, applicationTypeName, version, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(resourceGroupName, clusterName, applicationTypeName, version, parameters, options, optionalCallback); + } + } + + /** + * @summary Deletes a Service Fabric application type version resource. + * + * Delete a Service Fabric application type version resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {string} version The application type version. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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, clusterName, applicationTypeName, version, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, clusterName, applicationTypeName, version, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a Service Fabric application type version resource. + * + * Delete a Service Fabric application type version resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {string} version The application type version. + * + * @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, clusterName, applicationTypeName, version, 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, clusterName, applicationTypeName, version, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, clusterName, applicationTypeName, version, options, optionalCallback); + } + } + + /** + * @summary Gets the list of application type version resources created in the + * specified Service Fabric application type name resource. + * + * Gets all application type version resources created or in the process of + * being created in the Service Fabric application type name resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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(resourceGroupName, clusterName, applicationTypeName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, clusterName, applicationTypeName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the list of application type version resources created in the + * specified Service Fabric application type name resource. + * + * Gets all application type version resources created or in the process of + * being created in the Service Fabric application type name resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @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 {ApplicationTypeVersionResourceList} - 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 ApplicationTypeVersionResourceList} 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(resourceGroupName, clusterName, applicationTypeName, 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(resourceGroupName, clusterName, applicationTypeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, clusterName, applicationTypeName, options, optionalCallback); + } + } + + /** + * @summary Creates or updates a Service Fabric application type version + * resource. + * + * Create or update a Service Fabric application type version resource with the + * specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {string} version The application type version. + * + * @param {object} parameters The application type version resource. + * + * @param {string} parameters.appPackageUrl The URL to the application package + * + * @param {string} [parameters.location] Azure resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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. + */ + beginCreateWithHttpOperationResponse(resourceGroupName, clusterName, applicationTypeName, version, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, clusterName, applicationTypeName, version, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a Service Fabric application type version + * resource. + * + * Create or update a Service Fabric application type version resource with the + * specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {string} version The application type version. + * + * @param {object} parameters The application type version resource. + * + * @param {string} parameters.appPackageUrl The URL to the application package + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 {ApplicationTypeVersionResource} - 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 ApplicationTypeVersionResource} 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. + */ + beginCreate(resourceGroupName, clusterName, applicationTypeName, version, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, clusterName, applicationTypeName, version, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreate(resourceGroupName, clusterName, applicationTypeName, version, parameters, options, optionalCallback); + } + } + + /** + * @summary Deletes a Service Fabric application type version resource. + * + * Delete a Service Fabric application type version resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {string} version The application type version. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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(resourceGroupName, clusterName, applicationTypeName, version, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, clusterName, applicationTypeName, version, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a Service Fabric application type version resource. + * + * Delete a Service Fabric application type version resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {string} version The application type version. + * + * @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(resourceGroupName, clusterName, applicationTypeName, version, 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(resourceGroupName, clusterName, applicationTypeName, version, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, clusterName, applicationTypeName, version, options, optionalCallback); + } + } + +} + +module.exports = ApplicationTypeVersions; diff --git a/lib/services/serviceFabricManagement/lib/operations/applicationTypes.js b/lib/services/serviceFabricManagement/lib/operations/applicationTypes.js new file mode 100644 index 0000000000..55f3f92df1 --- /dev/null +++ b/lib/services/serviceFabricManagement/lib/operations/applicationTypes.js @@ -0,0 +1,1214 @@ +/* + * 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; + +/** + * @summary Gets a Service Fabric application type name resource. + * + * Get a Service Fabric application type name resource created or in the + * process of being created in the Service Fabric cluster resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @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 ApplicationTypeResource} 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, clusterName, applicationTypeName, 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 apiVersion = '2017-07-01-preview'; + // 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 (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (applicationTypeName === null || applicationTypeName === undefined || typeof applicationTypeName.valueOf() !== 'string') { + throw new Error('applicationTypeName 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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{applicationTypeName}', encodeURIComponent(applicationTypeName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ApplicationTypeResource']().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); + }); +} + +/** + * @summary Creates or updates a Service Fabric application type name resource. + * + * Create or update a Service Fabric application type name resource with the + * specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {object} parameters The application type name resource. + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 ApplicationTypeResource} 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 _create(resourceGroupName, clusterName, applicationTypeName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-07-01-preview'; + // 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 (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (applicationTypeName === null || applicationTypeName === undefined || typeof applicationTypeName.valueOf() !== 'string') { + throw new Error('applicationTypeName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{applicationTypeName}', encodeURIComponent(applicationTypeName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ApplicationTypeResource']().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['ApplicationTypeResource']().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); + }); +} + + +/** + * @summary Deletes a Service Fabric application type name resource. + * + * Delete a Service Fabric application type name resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @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, clusterName, applicationTypeName, 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(resourceGroupName, clusterName, applicationTypeName, 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); + }); + }); +} + +/** + * @summary Gets the list of application type name resources created in the + * specified Service Fabric cluster resource. + * + * Gets all application type name resources created or in the process of being + * created in the Service Fabric cluster resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @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 ApplicationTypeResourceList} 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(resourceGroupName, clusterName, 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 apiVersion = '2017-07-01-preview'; + // 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 (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName 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.ServiceFabric/clusters/{clusterName}/applicationTypes'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ApplicationTypeResourceList']().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); + }); +} + +/** + * @summary Deletes a Service Fabric application type name resource. + * + * Delete a Service Fabric application type name resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @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(resourceGroupName, clusterName, applicationTypeName, 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 apiVersion = '2017-07-01-preview'; + // 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 (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (applicationTypeName === null || applicationTypeName === undefined || typeof applicationTypeName.valueOf() !== 'string') { + throw new Error('applicationTypeName 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.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{applicationTypeName}', encodeURIComponent(applicationTypeName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 ApplicationTypes. */ +class ApplicationTypes { + /** + * Create a ApplicationTypes. + * @param {ServiceFabricManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._create = _create; + this._deleteMethod = _deleteMethod; + this._list = _list; + this._beginDeleteMethod = _beginDeleteMethod; + } + + /** + * @summary Gets a Service Fabric application type name resource. + * + * Get a Service Fabric application type name resource created or in the + * process of being created in the Service Fabric cluster resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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, clusterName, applicationTypeName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, clusterName, applicationTypeName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a Service Fabric application type name resource. + * + * Get a Service Fabric application type name resource created or in the + * process of being created in the Service Fabric cluster resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @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 {ApplicationTypeResource} - 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 ApplicationTypeResource} 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, clusterName, applicationTypeName, 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, clusterName, applicationTypeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, clusterName, applicationTypeName, options, optionalCallback); + } + } + + /** + * @summary Creates or updates a Service Fabric application type name resource. + * + * Create or update a Service Fabric application type name resource with the + * specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {object} parameters The application type name resource. + * + * @param {string} [parameters.location] Azure resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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. + */ + createWithHttpOperationResponse(resourceGroupName, clusterName, applicationTypeName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(resourceGroupName, clusterName, applicationTypeName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a Service Fabric application type name resource. + * + * Create or update a Service Fabric application type name resource with the + * specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {object} parameters The application type name resource. + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 {ApplicationTypeResource} - 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 ApplicationTypeResource} 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. + */ + create(resourceGroupName, clusterName, applicationTypeName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._create(resourceGroupName, clusterName, applicationTypeName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(resourceGroupName, clusterName, applicationTypeName, parameters, options, optionalCallback); + } + } + + /** + * @summary Deletes a Service Fabric application type name resource. + * + * Delete a Service Fabric application type name resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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, clusterName, applicationTypeName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, clusterName, applicationTypeName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a Service Fabric application type name resource. + * + * Delete a Service Fabric application type name resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @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, clusterName, applicationTypeName, 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, clusterName, applicationTypeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, clusterName, applicationTypeName, options, optionalCallback); + } + } + + /** + * @summary Gets the list of application type name resources created in the + * specified Service Fabric cluster resource. + * + * Gets all application type name resources created or in the process of being + * created in the Service Fabric cluster resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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(resourceGroupName, clusterName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, clusterName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the list of application type name resources created in the + * specified Service Fabric cluster resource. + * + * Gets all application type name resources created or in the process of being + * created in the Service Fabric cluster resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @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 {ApplicationTypeResourceList} - 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 ApplicationTypeResourceList} 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(resourceGroupName, clusterName, 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(resourceGroupName, clusterName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, clusterName, options, optionalCallback); + } + } + + /** + * @summary Deletes a Service Fabric application type name resource. + * + * Delete a Service Fabric application type name resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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(resourceGroupName, clusterName, applicationTypeName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, clusterName, applicationTypeName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a Service Fabric application type name resource. + * + * Delete a Service Fabric application type name resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @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(resourceGroupName, clusterName, applicationTypeName, 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(resourceGroupName, clusterName, applicationTypeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, clusterName, applicationTypeName, options, optionalCallback); + } + } + +} + +module.exports = ApplicationTypes; diff --git a/lib/services/serviceFabricManagement/lib/operations/applications.js b/lib/services/serviceFabricManagement/lib/operations/applications.js new file mode 100644 index 0000000000..a610b0daab --- /dev/null +++ b/lib/services/serviceFabricManagement/lib/operations/applications.js @@ -0,0 +1,3407 @@ +/* + * 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; + +/** + * @summary Gets a Service Fabric application resource. + * + * Get a Service Fabric application resource created or in the process of being + * created in the Service Fabric cluster resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @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 ApplicationResource} 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, clusterName, applicationName, 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 apiVersion = '2017-07-01-preview'; + // 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 (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (applicationName === null || applicationName === undefined || typeof applicationName.valueOf() !== 'string') { + throw new Error('applicationName 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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{applicationName}', encodeURIComponent(applicationName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ApplicationResource']().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); + }); +} + + +/** + * @summary Creates or updates a Service Fabric application resource. + * + * Create or update a Service Fabric application resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} parameters The application resource. + * + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. + * + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. + * + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). + * + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} + * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [parameters.minimumNodes] The minimum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. If this property is set to zero, no capacity will be reserved. + * The value of this property cannot be more than the value of the MaximumNodes + * property. + * + * @param {number} [parameters.maximumNodes] The maximum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. By default, the value of this property is zero and it means + * that the services can be placed on any node. + * + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. + * + * @param {array} [parameters.metrics] List of application capacity metric + * description. + * + * @param {string} [parameters.typeName] The application type name as defined + * in the application manifest. + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 ApplicationResource} 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 _create(resourceGroupName, clusterName, applicationName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreate(resourceGroupName, clusterName, applicationName, parameters, 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['ApplicationResource']().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); + }); + }); +} + + +/** + * @summary Updates a Service Fabric application resource. + * + * Update a Service Fabric application resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} parameters The application resource for patch operations. + * + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. + * + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. + * + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). + * + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} + * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [parameters.minimumNodes] The minimum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. If this property is set to zero, no capacity will be reserved. + * The value of this property cannot be more than the value of the MaximumNodes + * property. + * + * @param {number} [parameters.maximumNodes] The maximum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. By default, the value of this property is zero and it means + * that the services can be placed on any node. + * + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. + * + * @param {array} [parameters.metrics] List of application capacity metric + * description. + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 ApplicationResourceUpdate} 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(resourceGroupName, clusterName, applicationName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, clusterName, applicationName, parameters, 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['ApplicationResourceUpdate']().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); + }); + }); +} + + +/** + * @summary Deletes a Service Fabric application resource. + * + * Delete a Service Fabric application resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @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, clusterName, applicationName, 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(resourceGroupName, clusterName, applicationName, 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); + }); + }); +} + +/** + * @summary Gets the list of application resources created in the specified + * Service Fabric cluster resource. + * + * Gets all application resources created or in the process of being created in + * the Service Fabric cluster resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @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 ApplicationResourceList} 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(resourceGroupName, clusterName, 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 apiVersion = '2017-07-01-preview'; + // 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 (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName 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.ServiceFabric/clusters/{clusterName}/applications'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ApplicationResourceList']().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); + }); +} + +/** + * @summary Creates or updates a Service Fabric application resource. + * + * Create or update a Service Fabric application resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} parameters The application resource. + * + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. + * + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. + * + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). + * + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} + * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [parameters.minimumNodes] The minimum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. If this property is set to zero, no capacity will be reserved. + * The value of this property cannot be more than the value of the MaximumNodes + * property. + * + * @param {number} [parameters.maximumNodes] The maximum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. By default, the value of this property is zero and it means + * that the services can be placed on any node. + * + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. + * + * @param {array} [parameters.metrics] List of application capacity metric + * description. + * + * @param {string} [parameters.typeName] The application type name as defined + * in the application manifest. + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 ApplicationResource} 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 _beginCreate(resourceGroupName, clusterName, applicationName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-07-01-preview'; + // 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 (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (applicationName === null || applicationName === undefined || typeof applicationName.valueOf() !== 'string') { + throw new Error('applicationName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{applicationName}', encodeURIComponent(applicationName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ApplicationResource']().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 !== 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 === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplicationResource']().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); + }); +} + +/** + * @summary Updates a Service Fabric application resource. + * + * Update a Service Fabric application resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} parameters The application resource for patch operations. + * + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. + * + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. + * + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). + * + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} + * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [parameters.minimumNodes] The minimum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. If this property is set to zero, no capacity will be reserved. + * The value of this property cannot be more than the value of the MaximumNodes + * property. + * + * @param {number} [parameters.maximumNodes] The maximum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. By default, the value of this property is zero and it means + * that the services can be placed on any node. + * + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. + * + * @param {array} [parameters.metrics] List of application capacity metric + * description. + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 ApplicationResourceUpdate} 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 _beginUpdate(resourceGroupName, clusterName, applicationName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-07-01-preview'; + // 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 (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (applicationName === null || applicationName === undefined || typeof applicationName.valueOf() !== 'string') { + throw new Error('applicationName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{applicationName}', encodeURIComponent(applicationName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ApplicationResourceUpdate']().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 !== 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 === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplicationResourceUpdate']().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); + }); +} + +/** + * @summary Deletes a Service Fabric application resource. + * + * Delete a Service Fabric application resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @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(resourceGroupName, clusterName, applicationName, 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 apiVersion = '2017-07-01-preview'; + // 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 (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (applicationName === null || applicationName === undefined || typeof applicationName.valueOf() !== 'string') { + throw new Error('applicationName 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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{applicationName}', encodeURIComponent(applicationName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 Applications. */ +class Applications { + /** + * Create a Applications. + * @param {ServiceFabricManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._create = _create; + this._update = _update; + this._deleteMethod = _deleteMethod; + this._list = _list; + this._beginCreate = _beginCreate; + this._beginUpdate = _beginUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + } + + /** + * @summary Gets a Service Fabric application resource. + * + * Get a Service Fabric application resource created or in the process of being + * created in the Service Fabric cluster resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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, clusterName, applicationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, clusterName, applicationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a Service Fabric application resource. + * + * Get a Service Fabric application resource created or in the process of being + * created in the Service Fabric cluster resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @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 {ApplicationResource} - 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 ApplicationResource} 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, clusterName, applicationName, 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, clusterName, applicationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, clusterName, applicationName, options, optionalCallback); + } + } + + /** + * @summary Creates or updates a Service Fabric application resource. + * + * Create or update a Service Fabric application resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} parameters The application resource. + * + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. + * + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. + * + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). + * + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} + * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [parameters.minimumNodes] The minimum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. If this property is set to zero, no capacity will be reserved. + * The value of this property cannot be more than the value of the MaximumNodes + * property. + * + * @param {number} [parameters.maximumNodes] The maximum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. By default, the value of this property is zero and it means + * that the services can be placed on any node. + * + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. + * + * @param {array} [parameters.metrics] List of application capacity metric + * description. + * + * @param {string} [parameters.typeName] The application type name as defined + * in the application manifest. + * + * @param {string} [parameters.location] Azure resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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. + */ + createWithHttpOperationResponse(resourceGroupName, clusterName, applicationName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(resourceGroupName, clusterName, applicationName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a Service Fabric application resource. + * + * Create or update a Service Fabric application resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} parameters The application resource. + * + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. + * + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. + * + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). + * + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} + * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [parameters.minimumNodes] The minimum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. If this property is set to zero, no capacity will be reserved. + * The value of this property cannot be more than the value of the MaximumNodes + * property. + * + * @param {number} [parameters.maximumNodes] The maximum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. By default, the value of this property is zero and it means + * that the services can be placed on any node. + * + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. + * + * @param {array} [parameters.metrics] List of application capacity metric + * description. + * + * @param {string} [parameters.typeName] The application type name as defined + * in the application manifest. + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 {ApplicationResource} - 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 ApplicationResource} 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. + */ + create(resourceGroupName, clusterName, applicationName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._create(resourceGroupName, clusterName, applicationName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(resourceGroupName, clusterName, applicationName, parameters, options, optionalCallback); + } + } + + /** + * @summary Updates a Service Fabric application resource. + * + * Update a Service Fabric application resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} parameters The application resource for patch operations. + * + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. + * + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. + * + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). + * + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} + * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [parameters.minimumNodes] The minimum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. If this property is set to zero, no capacity will be reserved. + * The value of this property cannot be more than the value of the MaximumNodes + * property. + * + * @param {number} [parameters.maximumNodes] The maximum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. By default, the value of this property is zero and it means + * that the services can be placed on any node. + * + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. + * + * @param {array} [parameters.metrics] List of application capacity metric + * description. + * + * @param {string} [parameters.location] Azure resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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(resourceGroupName, clusterName, applicationName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, clusterName, applicationName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates a Service Fabric application resource. + * + * Update a Service Fabric application resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} parameters The application resource for patch operations. + * + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. + * + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. + * + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). + * + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} + * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [parameters.minimumNodes] The minimum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. If this property is set to zero, no capacity will be reserved. + * The value of this property cannot be more than the value of the MaximumNodes + * property. + * + * @param {number} [parameters.maximumNodes] The maximum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. By default, the value of this property is zero and it means + * that the services can be placed on any node. + * + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. + * + * @param {array} [parameters.metrics] List of application capacity metric + * description. + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 {ApplicationResourceUpdate} - 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 ApplicationResourceUpdate} 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(resourceGroupName, clusterName, applicationName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, clusterName, applicationName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, clusterName, applicationName, parameters, options, optionalCallback); + } + } + + /** + * @summary Deletes a Service Fabric application resource. + * + * Delete a Service Fabric application resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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, clusterName, applicationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, clusterName, applicationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a Service Fabric application resource. + * + * Delete a Service Fabric application resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @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, clusterName, applicationName, 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, clusterName, applicationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, clusterName, applicationName, options, optionalCallback); + } + } + + /** + * @summary Gets the list of application resources created in the specified + * Service Fabric cluster resource. + * + * Gets all application resources created or in the process of being created in + * the Service Fabric cluster resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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(resourceGroupName, clusterName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, clusterName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the list of application resources created in the specified + * Service Fabric cluster resource. + * + * Gets all application resources created or in the process of being created in + * the Service Fabric cluster resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @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 {ApplicationResourceList} - 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 ApplicationResourceList} 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(resourceGroupName, clusterName, 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(resourceGroupName, clusterName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, clusterName, options, optionalCallback); + } + } + + /** + * @summary Creates or updates a Service Fabric application resource. + * + * Create or update a Service Fabric application resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} parameters The application resource. + * + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. + * + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. + * + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). + * + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} + * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [parameters.minimumNodes] The minimum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. If this property is set to zero, no capacity will be reserved. + * The value of this property cannot be more than the value of the MaximumNodes + * property. + * + * @param {number} [parameters.maximumNodes] The maximum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. By default, the value of this property is zero and it means + * that the services can be placed on any node. + * + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. + * + * @param {array} [parameters.metrics] List of application capacity metric + * description. + * + * @param {string} [parameters.typeName] The application type name as defined + * in the application manifest. + * + * @param {string} [parameters.location] Azure resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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. + */ + beginCreateWithHttpOperationResponse(resourceGroupName, clusterName, applicationName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, clusterName, applicationName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a Service Fabric application resource. + * + * Create or update a Service Fabric application resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} parameters The application resource. + * + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. + * + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. + * + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). + * + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} + * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [parameters.minimumNodes] The minimum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. If this property is set to zero, no capacity will be reserved. + * The value of this property cannot be more than the value of the MaximumNodes + * property. + * + * @param {number} [parameters.maximumNodes] The maximum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. By default, the value of this property is zero and it means + * that the services can be placed on any node. + * + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. + * + * @param {array} [parameters.metrics] List of application capacity metric + * description. + * + * @param {string} [parameters.typeName] The application type name as defined + * in the application manifest. + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 {ApplicationResource} - 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 ApplicationResource} 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. + */ + beginCreate(resourceGroupName, clusterName, applicationName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, clusterName, applicationName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreate(resourceGroupName, clusterName, applicationName, parameters, options, optionalCallback); + } + } + + /** + * @summary Updates a Service Fabric application resource. + * + * Update a Service Fabric application resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} parameters The application resource for patch operations. + * + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. + * + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. + * + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). + * + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} + * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [parameters.minimumNodes] The minimum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. If this property is set to zero, no capacity will be reserved. + * The value of this property cannot be more than the value of the MaximumNodes + * property. + * + * @param {number} [parameters.maximumNodes] The maximum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. By default, the value of this property is zero and it means + * that the services can be placed on any node. + * + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. + * + * @param {array} [parameters.metrics] List of application capacity metric + * description. + * + * @param {string} [parameters.location] Azure resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, clusterName, applicationName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, clusterName, applicationName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates a Service Fabric application resource. + * + * Update a Service Fabric application resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} parameters The application resource for patch operations. + * + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. + * + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. + * + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). + * + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} + * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [parameters.minimumNodes] The minimum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. If this property is set to zero, no capacity will be reserved. + * The value of this property cannot be more than the value of the MaximumNodes + * property. + * + * @param {number} [parameters.maximumNodes] The maximum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. By default, the value of this property is zero and it means + * that the services can be placed on any node. + * + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. + * + * @param {array} [parameters.metrics] List of application capacity metric + * description. + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 {ApplicationResourceUpdate} - 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 ApplicationResourceUpdate} 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. + */ + beginUpdate(resourceGroupName, clusterName, applicationName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, clusterName, applicationName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, clusterName, applicationName, parameters, options, optionalCallback); + } + } + + /** + * @summary Deletes a Service Fabric application resource. + * + * Delete a Service Fabric application resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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(resourceGroupName, clusterName, applicationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, clusterName, applicationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a Service Fabric application resource. + * + * Delete a Service Fabric application resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @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(resourceGroupName, clusterName, applicationName, 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(resourceGroupName, clusterName, applicationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, clusterName, applicationName, options, optionalCallback); + } + } + +} + +module.exports = Applications; diff --git a/lib/services/serviceFabricManagement/lib/operations/clusterVersions.js b/lib/services/serviceFabricManagement/lib/operations/clusterVersions.js index ff488f6c15..8496d27c85 100644 --- a/lib/services/serviceFabricManagement/lib/operations/clusterVersions.js +++ b/lib/services/serviceFabricManagement/lib/operations/clusterVersions.js @@ -15,15 +15,15 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * @summary Get cluster code versions + * @summary Gets information about a Service Fabric cluster code version + * available in the specified location. * - * Get cluster code versions by location + * Gets information about an available Service Fabric cluster code version. * + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location - * - * @param {string} clusterVersion The cluster code version + * @param {string} clusterVersion The cluster code version. * * @param {object} [options] Optional Parameters. * @@ -54,14 +54,12 @@ function _get(location, clusterVersion, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { throw new Error('location cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -82,7 +80,7 @@ function _get(location, clusterVersion, options, callback) { requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{clusterVersion}', encodeURIComponent(clusterVersion)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -165,18 +163,19 @@ function _get(location, clusterVersion, options, callback) { } /** - * @summary Get cluster code versions by environment + * @summary Gets information about a Service Fabric cluster code version + * available for the specified environment. * - * Get cluster code versions by environment + * Gets information about an available Service Fabric cluster code version by + * environment. * + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location + * @param {string} environment The operating system of the cluster. The default + * means all. Possible values include: 'Windows', 'Linux' * - * @param {string} environment Cluster operating system, the default means all. - * Possible values include: 'Windows', 'Linux' - * - * @param {string} clusterVersion The cluster code version + * @param {string} clusterVersion The cluster code version. * * @param {object} [options] Optional Parameters. * @@ -207,6 +206,7 @@ function _getByEnvironment(location, environment, clusterVersion, options, callb if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { @@ -215,9 +215,6 @@ function _getByEnvironment(location, environment, clusterVersion, options, callb if (environment === null || environment === undefined || typeof environment.valueOf() !== 'string') { throw new Error('environment cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -239,7 +236,7 @@ function _getByEnvironment(location, environment, clusterVersion, options, callb requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); requestUrl = requestUrl.replace('{clusterVersion}', encodeURIComponent(clusterVersion)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -322,13 +319,14 @@ function _getByEnvironment(location, environment, clusterVersion, options, callb } /** - * @summary List cluster code versions by location + * @summary Gets the list of Service Fabric cluster code versions available for + * the specified location. * - * List cluster code versions by location + * Gets all available code versions for Service Fabric cluster resources by + * location. * - * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * * @param {object} [options] Optional Parameters. * @@ -359,14 +357,12 @@ function _list(location, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { throw new Error('location cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -383,7 +379,7 @@ function _list(location, options, callback) { requestUrl = requestUrl.replace('{location}', encodeURIComponent(location)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -466,16 +462,17 @@ function _list(location, options, callback) { } /** - * @summary List cluster code versions by environment + * @summary Gets the list of Service Fabric cluster code versions available for + * the specified environment. * - * List cluster code versions by environment + * Gets all available code versions for Service Fabric cluster resources by + * environment. * + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location - * - * @param {string} environment Cluster operating system, the default means all. - * Possible values include: 'Windows', 'Linux' + * @param {string} environment The operating system of the cluster. The default + * means all. Possible values include: 'Windows', 'Linux' * * @param {object} [options] Optional Parameters. * @@ -506,6 +503,7 @@ function _listByEnvironment(location, environment, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (location === null || location === undefined || typeof location.valueOf() !== 'string') { @@ -514,9 +512,6 @@ function _listByEnvironment(location, environment, options, callback) { if (environment === null || environment === undefined || typeof environment.valueOf() !== 'string') { throw new Error('environment cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -534,7 +529,7 @@ function _listByEnvironment(location, environment, options, callback) { requestUrl = requestUrl.replace('{environment}', encodeURIComponent(environment)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -631,15 +626,15 @@ class ClusterVersions { } /** - * @summary Get cluster code versions + * @summary Gets information about a Service Fabric cluster code version + * available in the specified location. * - * Get cluster code versions by location + * Gets information about an available Service Fabric cluster code version. * + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location - * - * @param {string} clusterVersion The cluster code version + * @param {string} clusterVersion The cluster code version. * * @param {object} [options] Optional Parameters. * @@ -667,15 +662,15 @@ class ClusterVersions { } /** - * @summary Get cluster code versions - * - * Get cluster code versions by location + * @summary Gets information about a Service Fabric cluster code version + * available in the specified location. * + * Gets information about an available Service Fabric cluster code version. * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * - * @param {string} clusterVersion The cluster code version + * @param {string} clusterVersion The cluster code version. * * @param {object} [options] Optional Parameters. * @@ -726,18 +721,19 @@ class ClusterVersions { } /** - * @summary Get cluster code versions by environment + * @summary Gets information about a Service Fabric cluster code version + * available for the specified environment. * - * Get cluster code versions by environment + * Gets information about an available Service Fabric cluster code version by + * environment. * + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location + * @param {string} environment The operating system of the cluster. The default + * means all. Possible values include: 'Windows', 'Linux' * - * @param {string} environment Cluster operating system, the default means all. - * Possible values include: 'Windows', 'Linux' - * - * @param {string} clusterVersion The cluster code version + * @param {string} clusterVersion The cluster code version. * * @param {object} [options] Optional Parameters. * @@ -765,18 +761,19 @@ class ClusterVersions { } /** - * @summary Get cluster code versions by environment - * - * Get cluster code versions by environment + * @summary Gets information about a Service Fabric cluster code version + * available for the specified environment. * + * Gets information about an available Service Fabric cluster code version by + * environment. * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * - * @param {string} environment Cluster operating system, the default means all. - * Possible values include: 'Windows', 'Linux' + * @param {string} environment The operating system of the cluster. The default + * means all. Possible values include: 'Windows', 'Linux' * - * @param {string} clusterVersion The cluster code version + * @param {string} clusterVersion The cluster code version. * * @param {object} [options] Optional Parameters. * @@ -827,13 +824,14 @@ class ClusterVersions { } /** - * @summary List cluster code versions by location + * @summary Gets the list of Service Fabric cluster code versions available for + * the specified location. * - * List cluster code versions by location + * Gets all available code versions for Service Fabric cluster resources by + * location. * - * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * * @param {object} [options] Optional Parameters. * @@ -861,13 +859,14 @@ class ClusterVersions { } /** - * @summary List cluster code versions by location - * - * List cluster code versions by location + * @summary Gets the list of Service Fabric cluster code versions available for + * the specified location. * + * Gets all available code versions for Service Fabric cluster resources by + * location. * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * * @param {object} [options] Optional Parameters. * @@ -918,16 +917,17 @@ class ClusterVersions { } /** - * @summary List cluster code versions by environment + * @summary Gets the list of Service Fabric cluster code versions available for + * the specified environment. * - * List cluster code versions by environment + * Gets all available code versions for Service Fabric cluster resources by + * environment. * + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location - * - * @param {string} environment Cluster operating system, the default means all. - * Possible values include: 'Windows', 'Linux' + * @param {string} environment The operating system of the cluster. The default + * means all. Possible values include: 'Windows', 'Linux' * * @param {object} [options] Optional Parameters. * @@ -955,16 +955,17 @@ class ClusterVersions { } /** - * @summary List cluster code versions by environment - * - * List cluster code versions by environment + * @summary Gets the list of Service Fabric cluster code versions available for + * the specified environment. * + * Gets all available code versions for Service Fabric cluster resources by + * environment. * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * - * @param {string} environment Cluster operating system, the default means all. - * Possible values include: 'Windows', 'Linux' + * @param {string} environment The operating system of the cluster. The default + * means all. Possible values include: 'Windows', 'Linux' * * @param {object} [options] Optional Parameters. * diff --git a/lib/services/serviceFabricManagement/lib/operations/clusters.js b/lib/services/serviceFabricManagement/lib/operations/clusters.js index 9fa02a037c..37a86965bd 100644 --- a/lib/services/serviceFabricManagement/lib/operations/clusters.js +++ b/lib/services/serviceFabricManagement/lib/operations/clusters.js @@ -14,199 +14,412 @@ const msRest = require('ms-rest'); const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; - /** - * @summary Create a ServiceFabric cluster - * - * Create cluster resource + * @summary Gets a Service Fabric cluster resource. * + * Get a Service Fabric cluster resource created or in the process of being + * created in the specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource - * - * @param {object} cluster The cluster resource. - * - * @param {array} [cluster.availableClusterVersions] The Service Fabric runtime - * versions available for this cluster. + * @param {string} clusterName The name of the cluster resource. * - * @param {string} [cluster.clusterState] Possible values include: - * 'WaitingForNodes', 'Deploying', 'BaselineUpgrade', - * 'UpdatingUserConfiguration', 'UpdatingUserCertificate', - * 'UpdatingInfrastructure', 'EnforcingClusterVersion', - * 'UpgradeServiceUnreachable', 'AutoScale', 'Ready' - * - * @param {string} [cluster.clusterCodeVersion] The Service Fabric runtime - * version of the cluster. This property can only by set the user when - * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric - * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To - * get the list of available version for existing clusters use - * **availableClusterVersions**. + * @param {object} [options] Optional Parameters. * - * @param {object} [cluster.certificate] The certificate to use for securing - * the cluster. The certificate provided will be used for node to node - * security within the cluster, SSL certificate for cluster management endpoint - * and default admin client. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [cluster.reliabilityLevel] Possible values include: 'None', - * 'Bronze', 'Silver', 'Gold', 'Platinum' + * @param {function} callback - The callback. * - * @param {string} [cluster.upgradeMode] Possible values include: 'Automatic', - * 'Manual' + * @returns {function} callback(err, result, request, response) * - * @param {array} [cluster.clientCertificateThumbprints] The list of client - * certificates referenced by thumbprint that are allowed to manage the - * cluster. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {array} [cluster.clientCertificateCommonNames] The list of client - * certificates referenced by common name that are allowed to manage the - * cluster. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Cluster} for more information. * - * @param {array} [cluster.fabricSettings] The list of custom fabric settings - * to configure the cluster. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [cluster.reverseProxyCertificate] The server certificate - * used by reverse proxy. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, clusterName, 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 apiVersion = '2018-02-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['Cluster']().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); + }); +} + + +/** + * @summary Creates or updates a Service Fabric cluster resource. * - * @param {string} cluster.reverseProxyCertificate.thumbprint Thumbprint of the - * primary certificate. + * Create or update a Service Fabric cluster resource with the specified name. * - * @param {string} [cluster.reverseProxyCertificate.thumbprintSecondary] - * Thumbprint of the secondary certificate. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [cluster.reverseProxyCertificate.x509StoreName] The local - * certificate store location. Possible values include: 'AddressBook', - * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', - * 'TrustedPeople', 'TrustedPublisher' + * @param {string} clusterName The name of the cluster resource. * - * @param {string} cluster.managementEndpoint The http management endpoint of - * the cluster. + * @param {object} parameters The cluster resource. * - * @param {array} cluster.nodeTypes The list of node types in the cluster. + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. * - * @param {object} [cluster.azureActiveDirectory] The AAD authentication + * @param {object} [parameters.azureActiveDirectory] The AAD authentication * settings of the cluster. * - * @param {string} [cluster.azureActiveDirectory.tenantId] Azure active + * @param {string} [parameters.azureActiveDirectory.tenantId] Azure active * directory tenant id. * - * @param {string} [cluster.azureActiveDirectory.clusterApplication] Azure + * @param {string} [parameters.azureActiveDirectory.clusterApplication] Azure * active directory cluster application id. * - * @param {string} [cluster.azureActiveDirectory.clientApplication] Azure + * @param {string} [parameters.azureActiveDirectory.clientApplication] Azure * active directory client application id. * - * @param {string} [cluster.vmImage] The VM image VMSS has been configured - * with. Generic names such as Windows or Linux can be used. + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node security + * within the cluster, SSL certificate for cluster management endpoint and + * default admin client. + * + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the + * cluster. + * + * @param {array} [parameters.clientCertificateCommonNames] The list of client + * certificates referenced by common name that are allowed to manage the + * cluster. + * + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. + * + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {object} [cluster.diagnosticsStorageAccountConfig] The storage + * @param {object} [parameters.diagnosticsStorageAccountConfig] The storage * account information for storing Service Fabric diagnostic logs. * - * @param {string} cluster.diagnosticsStorageAccountConfig.storageAccountName - * The Azure storage account name. + * @param {string} + * parameters.diagnosticsStorageAccountConfig.storageAccountName The Azure + * storage account name. * * @param {string} - * cluster.diagnosticsStorageAccountConfig.protectedAccountKeyName The + * parameters.diagnosticsStorageAccountConfig.protectedAccountKeyName The * protected diagnostics storage key name. * - * @param {string} cluster.diagnosticsStorageAccountConfig.blobEndpoint The + * @param {string} parameters.diagnosticsStorageAccountConfig.blobEndpoint The * blob endpoint of the azure storage account. * - * @param {string} cluster.diagnosticsStorageAccountConfig.queueEndpoint The + * @param {string} parameters.diagnosticsStorageAccountConfig.queueEndpoint The * queue endpoint of the azure storage account. * - * @param {string} cluster.diagnosticsStorageAccountConfig.tableEndpoint The + * @param {string} parameters.diagnosticsStorageAccountConfig.tableEndpoint The * table endpoint of the azure storage account. * - * @param {object} [cluster.upgradeDescription] The policy to use when + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. + * + * @param {string} parameters.managementEndpoint The http management endpoint + * of the cluster. + * + * @param {array} parameters.nodeTypes The list of node types in the cluster. + * + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + * + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' + * + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. + * + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. + * + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] + * Thumbprint of the secondary certificate. + * + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' + * + * @param {object} [parameters.reverseProxyCertificateCommonNames] Describes a + * list of server certificates referenced by common name that are used to + * secure the cluster. + * + * @param {array} [parameters.reverseProxyCertificateCommonNames.commonNames] + * The list of server certificates referenced by common name that are used to + * secure the cluster. + * + * @param {string} + * [parameters.reverseProxyCertificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' + * + * @param {object} [parameters.upgradeDescription] The policy to use when * upgrading the cluster. * - * @param {boolean} [cluster.upgradeDescription.forceRestart] If true, then + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then * processes are forcefully restarted during upgrade even when the code version * has not changed (the upgrade only changes configuration or data). * - * @param {string} cluster.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of * availability loss issues. The timeout is reset at the start of each upgrade * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckWaitDuration The + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The * length of time to wait after completing an upgrade domain before performing * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms * format. * - * @param {string} cluster.upgradeDescription.healthCheckStableDuration The + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The * amount of time that the application or cluster must remain healthy before * the upgrade proceeds to the next upgrade domain. The duration can be in * either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckRetryTimeout The + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The * amount of time to retry health evaluation when the application or cluster is * unhealthy before the upgrade rolls back. The timeout can be in either * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeTimeout The amount of time - * the overall upgrade has to complete before the upgrade rolls back. The + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} cluster.upgradeDescription.healthPolicy The cluster health - * policy used when upgrading the cluster. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The * maximum allowed percentage of unhealthy nodes before reporting an error. For * example, to allow 10% of nodes to be unhealthy, this value would be 10. * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * + * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this value * would be 10. * - * @param {object} [cluster.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * + * + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. + * + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. * - * @param {array} [cluster.addOnFeatures] The list of add-on features to enable - * in the cluster. + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' + * + * @param {string} [parameters.vmImage] The VM image VMSS has been configured + * with. Generic names such as Windows or Linux can be used. * - * @param {string} cluster.location Resource location. + * @param {string} parameters.location Azure resource location. * - * @param {object} [cluster.tags] Resource tags. + * @param {object} [parameters.tags] Azure resource tags. * * @param {object} [options] Optional Parameters. * @@ -226,7 +439,7 @@ const WebResource = msRest.WebResource; * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _create(resourceGroupName, clusterName, cluster, options, callback) { +function _create(resourceGroupName, clusterName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -239,7 +452,7 @@ function _create(resourceGroupName, clusterName, cluster, options, callback) { } // Send request - this.beginCreate(resourceGroupName, clusterName, cluster, options, (err, parsedResult, httpRequest, response) => { + this.beginCreate(resourceGroupName, clusterName, parameters, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -278,146 +491,302 @@ function _create(resourceGroupName, clusterName, cluster, options, callback) { }); } + /** - * @summary Delete cluster resource - * - * Delete cluster resource + * @summary Updates the configuration of a Service Fabric cluster resource. * + * Update the configuration of a Service Fabric cluster resource with the + * specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters The parameters which contains the property value + * and property name which used to update the cluster configuration. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. * - * @param {function} callback - The callback. + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node + * security within the cluster, SSL certificate for cluster management endpoint + * and default admin client. * - * @returns {function} callback(err, result, request, response) + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the + * cluster. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {array} [parameters.certificateCommonNames.commonNames] The list of + * server certificates referenced by common name that are used to secure the + * cluster. * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {string} [parameters.certificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {array} [parameters.clientCertificateCommonNames] The list of client + * certificates referenced by common name that are allowed to manage the + * cluster. This will overwrite the existing list. * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _deleteMethod(resourceGroupName, clusterName, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { - throw new Error('clusterName cannot be null or undefined and it must be of type string.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. This will overwrite the existing list. + * + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. + * + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. This will overwrite the existing list. + * + * @param {array} [parameters.nodeTypes] The list of node types in the cluster. + * This will overwrite the existing list. + * + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + * + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' + * + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. + * + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. + * + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] + * Thumbprint of the secondary certificate. + * + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' + * + * @param {object} [parameters.upgradeDescription] The policy to use when + * upgrading the cluster. + * + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The + * length of time to wait after completing an upgrade domain before performing + * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms + * format. + * + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The + * amount of time that the application or cluster must remain healthy before + * the upgrade proceeds to the next upgrade domain. The duration can be in + * either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The + * amount of time to retry health evaluation when the application or cluster is + * unhealthy before the upgrade rolls back. The timeout can be in either + * hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The + * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. + * + * @param {number} + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * maximum allowed percentage of unhealthy nodes before reporting an error. For + * example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * + * + * @param {number} + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * The maximum allowed percentage of unhealthy applications before reporting an + * error. For example, to allow 10% of applications to be unhealthy, this value + * would be 10. + * + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. + * + * @param {number} + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * The maximum allowed percentage of nodes health degradation allowed during + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * + * + * @param {number} + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * The maximum allowed percentage of upgrade domain nodes health degradation + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * + * + * @param {number} + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * The maximum allowed percentage of applications health degradation allowed + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * + * + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. + * + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. + * + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' + * + * @param {object} [parameters.tags] Cluster update parameters + * + * @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 Cluster} 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(resourceGroupName, clusterName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; } - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}'; - requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); - requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); - 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('&'); + if (!callback) { + throw new Error('callback cannot be null.'); } - // 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); + // Send request + this.beginUpdate(resourceGroupName, clusterName, parameters, 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; - let parsedErrorResponse; + + // Deserialize Response + let parsedResponse = null; 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'); + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Cluster']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); + } 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(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - return callback(null, result, httpRequest, response); + return callback(null, result, httpRequest, response); + }); }); } /** - * @summary Get cluster resource - * - * Get cluster resource + * @summary Deletes a Service Fabric cluster resource. * + * Delete a Service Fabric cluster resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {object} [options] Optional Parameters. * @@ -430,14 +799,13 @@ function _deleteMethod(resourceGroupName, clusterName, options, callback) { * * {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 Cluster} for more information. + * {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 _get(resourceGroupName, clusterName, options, callback) { +function _deleteMethod(resourceGroupName, clusterName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -447,6 +815,7 @@ function _get(resourceGroupName, clusterName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -455,9 +824,6 @@ function _get(resourceGroupName, clusterName, options, callback) { if (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { throw new Error('clusterName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -475,14 +841,14 @@ function _get(resourceGroupName, clusterName, options, callback) { requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -507,7 +873,7 @@ function _get(resourceGroupName, clusterName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -524,279 +890,29 @@ function _get(resourceGroupName, clusterName, options, callback) { } 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['Cluster']().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); - }); -} - - -/** - * @summary Update cluster configuration - * - * Update cluster configuration - * - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} clusterName The name of the cluster resource - * - * @param {object} clusterUpdateParameters The parameters which contains the - * property value and property name which used to update the cluster - * configuration. - * - * @param {string} [clusterUpdateParameters.reliabilityLevel] The reliability - * level sets the replica set size of system services. Learn about - * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). - * Possible values include: 'Bronze', 'Silver', 'Gold' - * - * @param {string} [clusterUpdateParameters.upgradeMode] The upgrade mode of - * the cluster. This indicates if the cluster should be automatically upgraded - * when new Service Fabric runtime version is available. Possible values - * include: 'Automatic', 'Manual' - * - * @param {string} [clusterUpdateParameters.clusterCodeVersion] The Service - * Fabric runtime version of the cluster. This property can only by set the - * user when **upgradeMode** is set to 'Manual'. To get list of available - * Service Fabric versions for new clusters use [ClusterVersion - * API](./ClusterVersion.md). To get the list of available version for existing - * clusters use **availableClusterVersions**. - * - * @param {object} [clusterUpdateParameters.certificate] The certificate to use - * for securing the cluster. The certificate provided will be used for node to - * node security within the cluster, SSL certificate for cluster management - * endpoint and default admin client. - * - * @param {array} [clusterUpdateParameters.clientCertificateThumbprints] The - * list of client certificates referenced by thumbprint that are allowed to - * manage the cluster. This will overwrite the existing list. - * - * @param {array} [clusterUpdateParameters.clientCertificateCommonNames] The - * list of client certificates referenced by common name that are allowed to - * manage the cluster. This will overwrite the existing list. - * - * @param {array} [clusterUpdateParameters.fabricSettings] The list of custom - * fabric settings to configure the cluster. This will overwrite the existing - * list. - * - * @param {object} [clusterUpdateParameters.reverseProxyCertificate] The server - * certificate used by reverse proxy. - * - * @param {string} clusterUpdateParameters.reverseProxyCertificate.thumbprint - * Thumbprint of the primary certificate. - * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.thumbprintSecondary] - * Thumbprint of the secondary certificate. - * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.x509StoreName] The local - * certificate store location. Possible values include: 'AddressBook', - * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', - * 'TrustedPeople', 'TrustedPublisher' - * - * @param {array} [clusterUpdateParameters.nodeTypes] The list of node types in - * the cluster. This will overwrite the existing list. - * - * @param {object} [clusterUpdateParameters.upgradeDescription] The policy to - * use when upgrading the cluster. - * - * @param {boolean} [clusterUpdateParameters.upgradeDescription.forceRestart] - * If true, then processes are forcefully restarted during upgrade even when - * the code version has not changed (the upgrade only changes configuration or - * data). - * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of - * availability loss issues. The timeout is reset at the start of each upgrade - * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckWaitDuration The - * length of time to wait after completing an upgrade domain before performing - * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms - * format. - * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckStableDuration The - * amount of time that the application or cluster must remain healthy before - * the upgrade proceeds to the next upgrade domain. The duration can be in - * either hh:mm:ss or in d.hh:mm:ss.ms format. - * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckRetryTimeout The - * amount of time to retry health evaluation when the application or cluster is - * unhealthy before the upgrade rolls back. The timeout can be in either - * hh:mm:ss or in d.hh:mm:ss.ms format. - * - * @param {string} clusterUpdateParameters.upgradeDescription.upgradeTimeout - * The amount of time the overall upgrade has to complete before the upgrade - * rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms - * format. - * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - * - * @param {object} clusterUpdateParameters.upgradeDescription.healthPolicy The - * cluster health policy used when upgrading the cluster. - * - * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] - * The maximum allowed percentage of unhealthy nodes before reporting an error. - * For example, to allow 10% of nodes to be unhealthy, this value would be 10. - * - * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] - * The maximum allowed percentage of unhealthy applications before reporting an - * error. For example, to allow 10% of applications to be unhealthy, this value - * would be 10. - * - * @param {object} - * [clusterUpdateParameters.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. - * - * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes - * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. - * - * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes - * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. - * - * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications - * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. - * - * @param {array} [clusterUpdateParameters.addOnFeatures] The list of add-on - * features to enable in the cluster. - * - * @param {object} [clusterUpdateParameters.tags] Cluster update parameters - * - * @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 Cluster} 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(resourceGroupName, clusterName, clusterUpdateParameters, 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.beginUpdate(resourceGroupName, clusterName, clusterUpdateParameters, 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['Cluster']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } - } 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); + } 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); - }); + return callback(null, result, httpRequest, response); }); } /** - * @summary List cluster resource by resource group - * - * List cluster resource by resource group + * @summary Gets the list of Service Fabric cluster resources created in the + * specified resource group. * + * Gets all Service Fabric cluster resources created or in the process of being + * created in the resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -828,14 +944,12 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -852,7 +966,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -936,10 +1050,11 @@ function _listByResourceGroup(resourceGroupName, options, callback) { } /** - * @summary List cluster resource - * - * List cluster resource + * @summary Gets the list of Service Fabric cluster resources created in the + * specified subscription. * + * Gets all Service Fabric cluster resources created or in the process of being + * created in the subscription. * * @param {object} [options] Optional Parameters. * @@ -969,11 +1084,9 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -989,7 +1102,7 @@ function _list(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/clusters'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1073,197 +1186,263 @@ function _list(options, callback) { } /** - * @summary Create a ServiceFabric cluster - * - * Create cluster resource + * @summary Creates or updates a Service Fabric cluster resource. * + * Create or update a Service Fabric cluster resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} cluster The cluster resource. + * @param {object} parameters The cluster resource. * - * @param {array} [cluster.availableClusterVersions] The Service Fabric runtime - * versions available for this cluster. + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. * - * @param {string} [cluster.clusterState] Possible values include: - * 'WaitingForNodes', 'Deploying', 'BaselineUpgrade', - * 'UpdatingUserConfiguration', 'UpdatingUserCertificate', - * 'UpdatingInfrastructure', 'EnforcingClusterVersion', - * 'UpgradeServiceUnreachable', 'AutoScale', 'Ready' + * @param {object} [parameters.azureActiveDirectory] The AAD authentication + * settings of the cluster. * - * @param {string} [cluster.clusterCodeVersion] The Service Fabric runtime - * version of the cluster. This property can only by set the user when - * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric - * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To - * get the list of available version for existing clusters use - * **availableClusterVersions**. + * @param {string} [parameters.azureActiveDirectory.tenantId] Azure active + * directory tenant id. * - * @param {object} [cluster.certificate] The certificate to use for securing - * the cluster. The certificate provided will be used for node to node - * security within the cluster, SSL certificate for cluster management endpoint - * and default admin client. + * @param {string} [parameters.azureActiveDirectory.clusterApplication] Azure + * active directory cluster application id. * - * @param {string} [cluster.reliabilityLevel] Possible values include: 'None', - * 'Bronze', 'Silver', 'Gold', 'Platinum' + * @param {string} [parameters.azureActiveDirectory.clientApplication] Azure + * active directory client application id. * - * @param {string} [cluster.upgradeMode] Possible values include: 'Automatic', - * 'Manual' + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node security + * within the cluster, SSL certificate for cluster management endpoint and + * default admin client. * - * @param {array} [cluster.clientCertificateThumbprints] The list of client - * certificates referenced by thumbprint that are allowed to manage the + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the * cluster. * - * @param {array} [cluster.clientCertificateCommonNames] The list of client + * @param {array} [parameters.clientCertificateCommonNames] The list of client * certificates referenced by common name that are allowed to manage the * cluster. * - * @param {array} [cluster.fabricSettings] The list of custom fabric settings - * to configure the cluster. + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. * - * @param {object} [cluster.reverseProxyCertificate] The server certificate - * used by reverse proxy. + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {string} cluster.reverseProxyCertificate.thumbprint Thumbprint of the - * primary certificate. + * @param {object} [parameters.diagnosticsStorageAccountConfig] The storage + * account information for storing Service Fabric diagnostic logs. * - * @param {string} [cluster.reverseProxyCertificate.thumbprintSecondary] - * Thumbprint of the secondary certificate. + * @param {string} + * parameters.diagnosticsStorageAccountConfig.storageAccountName The Azure + * storage account name. * - * @param {string} [cluster.reverseProxyCertificate.x509StoreName] The local - * certificate store location. Possible values include: 'AddressBook', - * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', - * 'TrustedPeople', 'TrustedPublisher' + * @param {string} + * parameters.diagnosticsStorageAccountConfig.protectedAccountKeyName The + * protected diagnostics storage key name. * - * @param {string} cluster.managementEndpoint The http management endpoint of - * the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.blobEndpoint The + * blob endpoint of the azure storage account. * - * @param {array} cluster.nodeTypes The list of node types in the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.queueEndpoint The + * queue endpoint of the azure storage account. * - * @param {object} [cluster.azureActiveDirectory] The AAD authentication - * settings of the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.tableEndpoint The + * table endpoint of the azure storage account. * - * @param {string} [cluster.azureActiveDirectory.tenantId] Azure active - * directory tenant id. + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. * - * @param {string} [cluster.azureActiveDirectory.clusterApplication] Azure - * active directory cluster application id. + * @param {string} parameters.managementEndpoint The http management endpoint + * of the cluster. * - * @param {string} [cluster.azureActiveDirectory.clientApplication] Azure - * active directory client application id. + * @param {array} parameters.nodeTypes The list of node types in the cluster. * - * @param {string} [cluster.vmImage] The VM image VMSS has been configured - * with. Generic names such as Windows or Linux can be used. + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). * - * @param {object} [cluster.diagnosticsStorageAccountConfig] The storage - * account information for storing Service Fabric diagnostic logs. + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' * - * @param {string} cluster.diagnosticsStorageAccountConfig.storageAccountName - * The Azure storage account name. + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. * - * @param {string} - * cluster.diagnosticsStorageAccountConfig.protectedAccountKeyName The - * protected diagnostics storage key name. + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. * - * @param {string} cluster.diagnosticsStorageAccountConfig.blobEndpoint The - * blob endpoint of the azure storage account. + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] + * Thumbprint of the secondary certificate. * - * @param {string} cluster.diagnosticsStorageAccountConfig.queueEndpoint The - * queue endpoint of the azure storage account. + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * @param {string} cluster.diagnosticsStorageAccountConfig.tableEndpoint The - * table endpoint of the azure storage account. + * @param {object} [parameters.reverseProxyCertificateCommonNames] Describes a + * list of server certificates referenced by common name that are used to + * secure the cluster. * - * @param {object} [cluster.upgradeDescription] The policy to use when + * @param {array} [parameters.reverseProxyCertificateCommonNames.commonNames] + * The list of server certificates referenced by common name that are used to + * secure the cluster. + * + * @param {string} + * [parameters.reverseProxyCertificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' + * + * @param {object} [parameters.upgradeDescription] The policy to use when * upgrading the cluster. * - * @param {boolean} [cluster.upgradeDescription.forceRestart] If true, then + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then * processes are forcefully restarted during upgrade even when the code version * has not changed (the upgrade only changes configuration or data). * - * @param {string} cluster.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of * availability loss issues. The timeout is reset at the start of each upgrade * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckWaitDuration The + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The * length of time to wait after completing an upgrade domain before performing * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms * format. * - * @param {string} cluster.upgradeDescription.healthCheckStableDuration The + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The * amount of time that the application or cluster must remain healthy before * the upgrade proceeds to the next upgrade domain. The duration can be in * either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckRetryTimeout The + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The * amount of time to retry health evaluation when the application or cluster is * unhealthy before the upgrade rolls back. The timeout can be in either * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeTimeout The amount of time - * the overall upgrade has to complete before the upgrade rolls back. The + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} cluster.upgradeDescription.healthPolicy The cluster health - * policy used when upgrading the cluster. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The * maximum allowed percentage of unhealthy nodes before reporting an error. For * example, to allow 10% of nodes to be unhealthy, this value would be 10. * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * + * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this value * would be 10. * - * @param {object} [cluster.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * + * + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. * - * @param {array} [cluster.addOnFeatures] The list of add-on features to enable - * in the cluster. + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. * - * @param {string} cluster.location Resource location. + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' * - * @param {object} [cluster.tags] Resource tags. + * @param {string} [parameters.vmImage] The VM image VMSS has been configured + * with. Generic names such as Windows or Linux can be used. + * + * @param {string} parameters.location Azure resource location. + * + * @param {object} [parameters.tags] Azure resource tags. * * @param {object} [options] Optional Parameters. * @@ -1283,7 +1462,7 @@ function _list(options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreate(resourceGroupName, clusterName, cluster, options, callback) { +function _beginCreate(resourceGroupName, clusterName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1293,6 +1472,7 @@ function _beginCreate(resourceGroupName, clusterName, cluster, options, callback if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1301,15 +1481,12 @@ function _beginCreate(resourceGroupName, clusterName, cluster, options, callback if (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { throw new Error('clusterName cannot be null or undefined and it must be of type string.'); } - if (cluster === null || cluster === undefined) { - throw new Error('cluster cannot be null or undefined.'); - } - if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { - throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1324,7 +1501,7 @@ function _beginCreate(resourceGroupName, clusterName, cluster, options, callback requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1353,14 +1530,14 @@ function _beginCreate(resourceGroupName, clusterName, cluster, options, callback let requestContent = null; let requestModel = null; try { - if (cluster !== null && cluster !== undefined) { + if (parameters !== null && parameters !== undefined) { let requestModelMapper = new client.models['Cluster']().mapper(); - requestModel = client.serialize(requestModelMapper, cluster, 'cluster'); + 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(cluster, null, 2)}.`); + `payload - ${JSON.stringify(parameters, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -1416,173 +1593,244 @@ function _beginCreate(resourceGroupName, clusterName, cluster, options, callback return callback(deserializationError); } } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Cluster']().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); }); } /** - * @summary Update cluster configuration - * - * Update cluster configuration + * @summary Updates the configuration of a Service Fabric cluster resource. * + * Update the configuration of a Service Fabric cluster resource with the + * specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} clusterUpdateParameters The parameters which contains the - * property value and property name which used to update the cluster - * configuration. + * @param {object} parameters The parameters which contains the property value + * and property name which used to update the cluster configuration. * - * @param {string} [clusterUpdateParameters.reliabilityLevel] The reliability - * level sets the replica set size of system services. Learn about - * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). - * Possible values include: 'Bronze', 'Silver', 'Gold' + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. * - * @param {string} [clusterUpdateParameters.upgradeMode] The upgrade mode of - * the cluster. This indicates if the cluster should be automatically upgraded - * when new Service Fabric runtime version is available. Possible values - * include: 'Automatic', 'Manual' + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node + * security within the cluster, SSL certificate for cluster management endpoint + * and default admin client. * - * @param {string} [clusterUpdateParameters.clusterCodeVersion] The Service - * Fabric runtime version of the cluster. This property can only by set the - * user when **upgradeMode** is set to 'Manual'. To get list of available - * Service Fabric versions for new clusters use [ClusterVersion - * API](./ClusterVersion.md). To get the list of available version for existing - * clusters use **availableClusterVersions**. + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the + * cluster. * - * @param {object} [clusterUpdateParameters.certificate] The certificate to use - * for securing the cluster. The certificate provided will be used for node to - * node security within the cluster, SSL certificate for cluster management - * endpoint and default admin client. + * @param {array} [parameters.certificateCommonNames.commonNames] The list of + * server certificates referenced by common name that are used to secure the + * cluster. * - * @param {array} [clusterUpdateParameters.clientCertificateThumbprints] The - * list of client certificates referenced by thumbprint that are allowed to - * manage the cluster. This will overwrite the existing list. + * @param {string} [parameters.certificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * @param {array} [clusterUpdateParameters.clientCertificateCommonNames] The - * list of client certificates referenced by common name that are allowed to - * manage the cluster. This will overwrite the existing list. + * @param {array} [parameters.clientCertificateCommonNames] The list of client + * certificates referenced by common name that are allowed to manage the + * cluster. This will overwrite the existing list. * - * @param {array} [clusterUpdateParameters.fabricSettings] The list of custom - * fabric settings to configure the cluster. This will overwrite the existing - * list. + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. This will overwrite the existing list. * - * @param {object} [clusterUpdateParameters.reverseProxyCertificate] The server - * certificate used by reverse proxy. + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {string} clusterUpdateParameters.reverseProxyCertificate.thumbprint - * Thumbprint of the primary certificate. + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. This will overwrite the existing list. * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.thumbprintSecondary] + * @param {array} [parameters.nodeTypes] The list of node types in the cluster. + * This will overwrite the existing list. + * + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + * + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' + * + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. + * + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. + * + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] * Thumbprint of the secondary certificate. * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.x509StoreName] The local + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local * certificate store location. Possible values include: 'AddressBook', * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', * 'TrustedPeople', 'TrustedPublisher' * - * @param {array} [clusterUpdateParameters.nodeTypes] The list of node types in - * the cluster. This will overwrite the existing list. - * - * @param {object} [clusterUpdateParameters.upgradeDescription] The policy to - * use when upgrading the cluster. + * @param {object} [parameters.upgradeDescription] The policy to use when + * upgrading the cluster. * - * @param {boolean} [clusterUpdateParameters.upgradeDescription.forceRestart] - * If true, then processes are forcefully restarted during upgrade even when - * the code version has not changed (the upgrade only changes configuration or - * data). + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of * availability loss issues. The timeout is reset at the start of each upgrade * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckWaitDuration The + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The * length of time to wait after completing an upgrade domain before performing * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms * format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckStableDuration The + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The * amount of time that the application or cluster must remain healthy before * the upgrade proceeds to the next upgrade domain. The duration can be in * either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckRetryTimeout The + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The * amount of time to retry health evaluation when the application or cluster is * unhealthy before the upgrade rolls back. The timeout can be in either * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} clusterUpdateParameters.upgradeDescription.upgradeTimeout - * The amount of time the overall upgrade has to complete before the upgrade - * rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms - * format. + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The + * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} clusterUpdateParameters.upgradeDescription.healthPolicy The - * cluster health policy used when upgrading the cluster. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] - * The maximum allowed percentage of unhealthy nodes before reporting an error. - * For example, to allow 10% of nodes to be unhealthy, this value would be 10. + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * maximum allowed percentage of unhealthy nodes before reporting an error. For + * example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * * * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this value * would be 10. * + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + * * @param {object} - * [clusterUpdateParameters.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * * - * @param {array} [clusterUpdateParameters.addOnFeatures] The list of add-on - * features to enable in the cluster. + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. + * + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. * - * @param {object} [clusterUpdateParameters.tags] Cluster update parameters + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' + * + * @param {object} [parameters.tags] Cluster update parameters * * @param {object} [options] Optional Parameters. * @@ -1602,7 +1850,7 @@ function _beginCreate(resourceGroupName, clusterName, cluster, options, callback * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginUpdate(resourceGroupName, clusterName, clusterUpdateParameters, options, callback) { +function _beginUpdate(resourceGroupName, clusterName, parameters, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1612,6 +1860,7 @@ function _beginUpdate(resourceGroupName, clusterName, clusterUpdateParameters, o if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2018-02-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1620,15 +1869,12 @@ function _beginUpdate(resourceGroupName, clusterName, clusterUpdateParameters, o if (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { throw new Error('clusterName 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 (clusterUpdateParameters === null || clusterUpdateParameters === undefined) { - throw new Error('clusterUpdateParameters 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 (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1643,7 +1889,7 @@ function _beginUpdate(resourceGroupName, clusterName, clusterUpdateParameters, o requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1672,14 +1918,14 @@ function _beginUpdate(resourceGroupName, clusterName, clusterUpdateParameters, o let requestContent = null; let requestModel = null; try { - if (clusterUpdateParameters !== null && clusterUpdateParameters !== undefined) { + if (parameters !== null && parameters !== undefined) { let requestModelMapper = new client.models['ClusterUpdateParameters']().mapper(); - requestModel = client.serialize(requestModelMapper, clusterUpdateParameters, 'clusterUpdateParameters'); + 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(clusterUpdateParameters, null, 2)}.`); + `payload - ${JSON.stringify(parameters, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -1735,6 +1981,23 @@ function _beginUpdate(resourceGroupName, clusterName, clusterUpdateParameters, o return callback(deserializationError); } } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Cluster']().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); }); @@ -1748,10 +2011,10 @@ class Clusters { */ constructor(client) { this.client = client; - this._create = _create; - this._deleteMethod = _deleteMethod; this._get = _get; + this._create = _create; this._update = _update; + this._deleteMethod = _deleteMethod; this._listByResourceGroup = _listByResourceGroup; this._list = _list; this._beginCreate = _beginCreate; @@ -1759,197 +2022,355 @@ class Clusters { } /** - * @summary Create a ServiceFabric cluster - * - * Create cluster resource + * @summary Gets a Service Fabric cluster resource. + * + * Get a Service Fabric cluster resource created or in the process of being + * created in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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, clusterName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, clusterName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a Service Fabric cluster resource. + * + * Get a Service Fabric cluster resource created or in the process of being + * created in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @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 {Cluster} - 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 Cluster} 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, clusterName, 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, clusterName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, clusterName, options, optionalCallback); + } + } + + /** + * @summary Creates or updates a Service Fabric cluster resource. * + * Create or update a Service Fabric cluster resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} cluster The cluster resource. + * @param {object} parameters The cluster resource. * - * @param {array} [cluster.availableClusterVersions] The Service Fabric runtime - * versions available for this cluster. + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. * - * @param {string} [cluster.clusterState] Possible values include: - * 'WaitingForNodes', 'Deploying', 'BaselineUpgrade', - * 'UpdatingUserConfiguration', 'UpdatingUserCertificate', - * 'UpdatingInfrastructure', 'EnforcingClusterVersion', - * 'UpgradeServiceUnreachable', 'AutoScale', 'Ready' + * @param {object} [parameters.azureActiveDirectory] The AAD authentication + * settings of the cluster. * - * @param {string} [cluster.clusterCodeVersion] The Service Fabric runtime - * version of the cluster. This property can only by set the user when - * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric - * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To - * get the list of available version for existing clusters use - * **availableClusterVersions**. + * @param {string} [parameters.azureActiveDirectory.tenantId] Azure active + * directory tenant id. * - * @param {object} [cluster.certificate] The certificate to use for securing - * the cluster. The certificate provided will be used for node to node - * security within the cluster, SSL certificate for cluster management endpoint - * and default admin client. + * @param {string} [parameters.azureActiveDirectory.clusterApplication] Azure + * active directory cluster application id. * - * @param {string} [cluster.reliabilityLevel] Possible values include: 'None', - * 'Bronze', 'Silver', 'Gold', 'Platinum' + * @param {string} [parameters.azureActiveDirectory.clientApplication] Azure + * active directory client application id. * - * @param {string} [cluster.upgradeMode] Possible values include: 'Automatic', - * 'Manual' + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node security + * within the cluster, SSL certificate for cluster management endpoint and + * default admin client. * - * @param {array} [cluster.clientCertificateThumbprints] The list of client - * certificates referenced by thumbprint that are allowed to manage the + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the * cluster. * - * @param {array} [cluster.clientCertificateCommonNames] The list of client + * @param {array} [parameters.clientCertificateCommonNames] The list of client * certificates referenced by common name that are allowed to manage the * cluster. * - * @param {array} [cluster.fabricSettings] The list of custom fabric settings - * to configure the cluster. + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. * - * @param {object} [cluster.reverseProxyCertificate] The server certificate - * used by reverse proxy. + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {string} cluster.reverseProxyCertificate.thumbprint Thumbprint of the - * primary certificate. + * @param {object} [parameters.diagnosticsStorageAccountConfig] The storage + * account information for storing Service Fabric diagnostic logs. * - * @param {string} [cluster.reverseProxyCertificate.thumbprintSecondary] - * Thumbprint of the secondary certificate. + * @param {string} + * parameters.diagnosticsStorageAccountConfig.storageAccountName The Azure + * storage account name. * - * @param {string} [cluster.reverseProxyCertificate.x509StoreName] The local - * certificate store location. Possible values include: 'AddressBook', - * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', - * 'TrustedPeople', 'TrustedPublisher' + * @param {string} + * parameters.diagnosticsStorageAccountConfig.protectedAccountKeyName The + * protected diagnostics storage key name. * - * @param {string} cluster.managementEndpoint The http management endpoint of - * the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.blobEndpoint The + * blob endpoint of the azure storage account. * - * @param {array} cluster.nodeTypes The list of node types in the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.queueEndpoint The + * queue endpoint of the azure storage account. * - * @param {object} [cluster.azureActiveDirectory] The AAD authentication - * settings of the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.tableEndpoint The + * table endpoint of the azure storage account. * - * @param {string} [cluster.azureActiveDirectory.tenantId] Azure active - * directory tenant id. + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. * - * @param {string} [cluster.azureActiveDirectory.clusterApplication] Azure - * active directory cluster application id. + * @param {string} parameters.managementEndpoint The http management endpoint + * of the cluster. * - * @param {string} [cluster.azureActiveDirectory.clientApplication] Azure - * active directory client application id. + * @param {array} parameters.nodeTypes The list of node types in the cluster. * - * @param {string} [cluster.vmImage] The VM image VMSS has been configured - * with. Generic names such as Windows or Linux can be used. + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). * - * @param {object} [cluster.diagnosticsStorageAccountConfig] The storage - * account information for storing Service Fabric diagnostic logs. + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' * - * @param {string} cluster.diagnosticsStorageAccountConfig.storageAccountName - * The Azure storage account name. + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. * - * @param {string} - * cluster.diagnosticsStorageAccountConfig.protectedAccountKeyName The - * protected diagnostics storage key name. + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. * - * @param {string} cluster.diagnosticsStorageAccountConfig.blobEndpoint The - * blob endpoint of the azure storage account. + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] + * Thumbprint of the secondary certificate. * - * @param {string} cluster.diagnosticsStorageAccountConfig.queueEndpoint The - * queue endpoint of the azure storage account. + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * @param {string} cluster.diagnosticsStorageAccountConfig.tableEndpoint The - * table endpoint of the azure storage account. + * @param {object} [parameters.reverseProxyCertificateCommonNames] Describes a + * list of server certificates referenced by common name that are used to + * secure the cluster. + * + * @param {array} [parameters.reverseProxyCertificateCommonNames.commonNames] + * The list of server certificates referenced by common name that are used to + * secure the cluster. + * + * @param {string} + * [parameters.reverseProxyCertificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * @param {object} [cluster.upgradeDescription] The policy to use when + * @param {object} [parameters.upgradeDescription] The policy to use when * upgrading the cluster. * - * @param {boolean} [cluster.upgradeDescription.forceRestart] If true, then + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then * processes are forcefully restarted during upgrade even when the code version * has not changed (the upgrade only changes configuration or data). * - * @param {string} cluster.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of * availability loss issues. The timeout is reset at the start of each upgrade * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckWaitDuration The + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The * length of time to wait after completing an upgrade domain before performing * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms * format. * - * @param {string} cluster.upgradeDescription.healthCheckStableDuration The + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The * amount of time that the application or cluster must remain healthy before * the upgrade proceeds to the next upgrade domain. The duration can be in * either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckRetryTimeout The + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The * amount of time to retry health evaluation when the application or cluster is * unhealthy before the upgrade rolls back. The timeout can be in either * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeTimeout The amount of time - * the overall upgrade has to complete before the upgrade rolls back. The + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} cluster.upgradeDescription.healthPolicy The cluster health - * policy used when upgrading the cluster. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The * maximum allowed percentage of unhealthy nodes before reporting an error. For * example, to allow 10% of nodes to be unhealthy, this value would be 10. * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * + * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this value * would be 10. * - * @param {object} [cluster.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * + * + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. * - * @param {array} [cluster.addOnFeatures] The list of add-on features to enable - * in the cluster. + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. * - * @param {string} cluster.location Resource location. + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' * - * @param {object} [cluster.tags] Resource tags. + * @param {string} [parameters.vmImage] The VM image VMSS has been configured + * with. Generic names such as Windows or Linux can be used. + * + * @param {string} parameters.location Azure resource location. + * + * @param {object} [parameters.tags] Azure resource tags. * * @param {object} [options] Optional Parameters. * @@ -1962,11 +2383,11 @@ class Clusters { * * @reject {Error} - The error object. */ - createWithHttpOperationResponse(resourceGroupName, clusterName, cluster, options) { + createWithHttpOperationResponse(resourceGroupName, clusterName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._create(resourceGroupName, clusterName, cluster, options, (err, result, request, response) => { + self._create(resourceGroupName, clusterName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1977,380 +2398,263 @@ class Clusters { } /** - * @summary Create a ServiceFabric cluster - * - * Create cluster resource + * @summary Creates or updates a Service Fabric cluster resource. * + * Create or update a Service Fabric cluster resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} cluster The cluster resource. + * @param {object} parameters The cluster resource. * - * @param {array} [cluster.availableClusterVersions] The Service Fabric runtime - * versions available for this cluster. + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. * - * @param {string} [cluster.clusterState] Possible values include: - * 'WaitingForNodes', 'Deploying', 'BaselineUpgrade', - * 'UpdatingUserConfiguration', 'UpdatingUserCertificate', - * 'UpdatingInfrastructure', 'EnforcingClusterVersion', - * 'UpgradeServiceUnreachable', 'AutoScale', 'Ready' + * @param {object} [parameters.azureActiveDirectory] The AAD authentication + * settings of the cluster. * - * @param {string} [cluster.clusterCodeVersion] The Service Fabric runtime - * version of the cluster. This property can only by set the user when - * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric - * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To - * get the list of available version for existing clusters use - * **availableClusterVersions**. + * @param {string} [parameters.azureActiveDirectory.tenantId] Azure active + * directory tenant id. * - * @param {object} [cluster.certificate] The certificate to use for securing - * the cluster. The certificate provided will be used for node to node - * security within the cluster, SSL certificate for cluster management endpoint - * and default admin client. + * @param {string} [parameters.azureActiveDirectory.clusterApplication] Azure + * active directory cluster application id. * - * @param {string} [cluster.reliabilityLevel] Possible values include: 'None', - * 'Bronze', 'Silver', 'Gold', 'Platinum' + * @param {string} [parameters.azureActiveDirectory.clientApplication] Azure + * active directory client application id. * - * @param {string} [cluster.upgradeMode] Possible values include: 'Automatic', - * 'Manual' + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node security + * within the cluster, SSL certificate for cluster management endpoint and + * default admin client. * - * @param {array} [cluster.clientCertificateThumbprints] The list of client - * certificates referenced by thumbprint that are allowed to manage the + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the * cluster. * - * @param {array} [cluster.clientCertificateCommonNames] The list of client + * @param {array} [parameters.clientCertificateCommonNames] The list of client * certificates referenced by common name that are allowed to manage the * cluster. * - * @param {array} [cluster.fabricSettings] The list of custom fabric settings - * to configure the cluster. + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. * - * @param {object} [cluster.reverseProxyCertificate] The server certificate - * used by reverse proxy. + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {string} cluster.reverseProxyCertificate.thumbprint Thumbprint of the - * primary certificate. + * @param {object} [parameters.diagnosticsStorageAccountConfig] The storage + * account information for storing Service Fabric diagnostic logs. * - * @param {string} [cluster.reverseProxyCertificate.thumbprintSecondary] - * Thumbprint of the secondary certificate. + * @param {string} + * parameters.diagnosticsStorageAccountConfig.storageAccountName The Azure + * storage account name. * - * @param {string} [cluster.reverseProxyCertificate.x509StoreName] The local - * certificate store location. Possible values include: 'AddressBook', - * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', - * 'TrustedPeople', 'TrustedPublisher' + * @param {string} + * parameters.diagnosticsStorageAccountConfig.protectedAccountKeyName The + * protected diagnostics storage key name. * - * @param {string} cluster.managementEndpoint The http management endpoint of - * the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.blobEndpoint The + * blob endpoint of the azure storage account. * - * @param {array} cluster.nodeTypes The list of node types in the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.queueEndpoint The + * queue endpoint of the azure storage account. * - * @param {object} [cluster.azureActiveDirectory] The AAD authentication - * settings of the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.tableEndpoint The + * table endpoint of the azure storage account. * - * @param {string} [cluster.azureActiveDirectory.tenantId] Azure active - * directory tenant id. + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. * - * @param {string} [cluster.azureActiveDirectory.clusterApplication] Azure - * active directory cluster application id. + * @param {string} parameters.managementEndpoint The http management endpoint + * of the cluster. * - * @param {string} [cluster.azureActiveDirectory.clientApplication] Azure - * active directory client application id. + * @param {array} parameters.nodeTypes The list of node types in the cluster. * - * @param {string} [cluster.vmImage] The VM image VMSS has been configured - * with. Generic names such as Windows or Linux can be used. + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). * - * @param {object} [cluster.diagnosticsStorageAccountConfig] The storage - * account information for storing Service Fabric diagnostic logs. + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' * - * @param {string} cluster.diagnosticsStorageAccountConfig.storageAccountName - * The Azure storage account name. + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. * - * @param {string} - * cluster.diagnosticsStorageAccountConfig.protectedAccountKeyName The - * protected diagnostics storage key name. + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. * - * @param {string} cluster.diagnosticsStorageAccountConfig.blobEndpoint The - * blob endpoint of the azure storage account. + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] + * Thumbprint of the secondary certificate. * - * @param {string} cluster.diagnosticsStorageAccountConfig.queueEndpoint The - * queue endpoint of the azure storage account. + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * @param {string} cluster.diagnosticsStorageAccountConfig.tableEndpoint The - * table endpoint of the azure storage account. + * @param {object} [parameters.reverseProxyCertificateCommonNames] Describes a + * list of server certificates referenced by common name that are used to + * secure the cluster. + * + * @param {array} [parameters.reverseProxyCertificateCommonNames.commonNames] + * The list of server certificates referenced by common name that are used to + * secure the cluster. + * + * @param {string} + * [parameters.reverseProxyCertificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * @param {object} [cluster.upgradeDescription] The policy to use when + * @param {object} [parameters.upgradeDescription] The policy to use when * upgrading the cluster. * - * @param {boolean} [cluster.upgradeDescription.forceRestart] If true, then + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then * processes are forcefully restarted during upgrade even when the code version * has not changed (the upgrade only changes configuration or data). * - * @param {string} cluster.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of * availability loss issues. The timeout is reset at the start of each upgrade * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckWaitDuration The + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The * length of time to wait after completing an upgrade domain before performing * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms * format. * - * @param {string} cluster.upgradeDescription.healthCheckStableDuration The + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The * amount of time that the application or cluster must remain healthy before * the upgrade proceeds to the next upgrade domain. The duration can be in * either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckRetryTimeout The + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The * amount of time to retry health evaluation when the application or cluster is * unhealthy before the upgrade rolls back. The timeout can be in either * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeTimeout The amount of time - * the overall upgrade has to complete before the upgrade rolls back. The + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} cluster.upgradeDescription.healthPolicy The cluster health - * policy used when upgrading the cluster. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The * maximum allowed percentage of unhealthy nodes before reporting an error. For * example, to allow 10% of nodes to be unhealthy, this value would be 10. * - * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] - * The maximum allowed percentage of unhealthy applications before reporting an - * error. For example, to allow 10% of applications to be unhealthy, this value - * would be 10. - * - * @param {object} [cluster.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. - * - * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes - * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. - * - * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes - * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. - * - * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications - * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. - * - * @param {array} [cluster.addOnFeatures] The list of add-on features to enable - * in the cluster. - * - * @param {string} cluster.location Resource location. - * - * @param {object} [cluster.tags] Resource tags. - * - * @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 {Cluster} - 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 Cluster} 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. - */ - create(resourceGroupName, clusterName, cluster, 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._create(resourceGroupName, clusterName, cluster, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._create(resourceGroupName, clusterName, cluster, options, optionalCallback); - } - } - - /** - * @summary Delete cluster resource - * - * Delete cluster resource - * - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} clusterName The name of the cluster resource - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [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, clusterName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, clusterName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Delete cluster resource - * - * Delete cluster resource - * - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} clusterName The name of the cluster resource - * - * @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. + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. * - * @reject {Error} - The error object. + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. * - * {function} optionalCallback(err, result, request, response) * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {number} + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * The maximum allowed percentage of unhealthy applications before reporting an + * error. For example, to allow 10% of applications to be unhealthy, this value + * would be 10. * - * {null} [result] - The deserialized result object if an error did not occur. + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. * - * {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, clusterName, 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, clusterName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteMethod(resourceGroupName, clusterName, options, optionalCallback); - } - } - - /** - * @summary Get cluster resource + * @param {object} + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. * - * Get cluster resource + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * + * @param {number} + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * The maximum allowed percentage of nodes health degradation allowed during + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. * - * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {number} + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * The maximum allowed percentage of upgrade domain nodes health degradation + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. * - * @param {object} [options] Optional Parameters. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {number} + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * The maximum allowed percentage of applications health degradation allowed + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. * - * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. * - * @reject {Error} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName, clusterName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, clusterName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get cluster resource + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. * - * Get cluster resource + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' * + * @param {string} [parameters.vmImage] The VM image VMSS has been configured + * with. Generic names such as Windows or Linux can be used. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} parameters.location Azure resource location. * - * @param {string} clusterName The name of the cluster resource + * @param {object} [parameters.tags] Azure resource tags. * * @param {object} [options] Optional Parameters. * @@ -2379,7 +2683,7 @@ class Clusters { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, clusterName, options, optionalCallback) { + create(resourceGroupName, clusterName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2388,179 +2692,233 @@ class Clusters { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, clusterName, options, (err, result, request, response) => { + self._create(resourceGroupName, clusterName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, clusterName, options, optionalCallback); + return self._create(resourceGroupName, clusterName, parameters, options, optionalCallback); } } /** - * @summary Update cluster configuration - * - * Update cluster configuration + * @summary Updates the configuration of a Service Fabric cluster resource. * + * Update the configuration of a Service Fabric cluster resource with the + * specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} clusterUpdateParameters The parameters which contains the - * property value and property name which used to update the cluster - * configuration. + * @param {object} parameters The parameters which contains the property value + * and property name which used to update the cluster configuration. * - * @param {string} [clusterUpdateParameters.reliabilityLevel] The reliability - * level sets the replica set size of system services. Learn about - * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). - * Possible values include: 'Bronze', 'Silver', 'Gold' + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. + * + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node + * security within the cluster, SSL certificate for cluster management endpoint + * and default admin client. + * + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the + * cluster. + * + * @param {array} [parameters.certificateCommonNames.commonNames] The list of + * server certificates referenced by common name that are used to secure the + * cluster. + * + * @param {string} [parameters.certificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' + * + * @param {array} [parameters.clientCertificateCommonNames] The list of client + * certificates referenced by common name that are allowed to manage the + * cluster. This will overwrite the existing list. * - * @param {string} [clusterUpdateParameters.upgradeMode] The upgrade mode of - * the cluster. This indicates if the cluster should be automatically upgraded - * when new Service Fabric runtime version is available. Possible values - * include: 'Automatic', 'Manual' + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. This will overwrite the existing list. * - * @param {string} [clusterUpdateParameters.clusterCodeVersion] The Service - * Fabric runtime version of the cluster. This property can only by set the - * user when **upgradeMode** is set to 'Manual'. To get list of available - * Service Fabric versions for new clusters use [ClusterVersion - * API](./ClusterVersion.md). To get the list of available version for existing - * clusters use **availableClusterVersions**. + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {object} [clusterUpdateParameters.certificate] The certificate to use - * for securing the cluster. The certificate provided will be used for node to - * node security within the cluster, SSL certificate for cluster management - * endpoint and default admin client. + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. This will overwrite the existing list. * - * @param {array} [clusterUpdateParameters.clientCertificateThumbprints] The - * list of client certificates referenced by thumbprint that are allowed to - * manage the cluster. This will overwrite the existing list. + * @param {array} [parameters.nodeTypes] The list of node types in the cluster. + * This will overwrite the existing list. * - * @param {array} [clusterUpdateParameters.clientCertificateCommonNames] The - * list of client certificates referenced by common name that are allowed to - * manage the cluster. This will overwrite the existing list. + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). * - * @param {array} [clusterUpdateParameters.fabricSettings] The list of custom - * fabric settings to configure the cluster. This will overwrite the existing - * list. + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' * - * @param {object} [clusterUpdateParameters.reverseProxyCertificate] The server - * certificate used by reverse proxy. + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. * - * @param {string} clusterUpdateParameters.reverseProxyCertificate.thumbprint - * Thumbprint of the primary certificate. + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.thumbprintSecondary] + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] * Thumbprint of the secondary certificate. * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.x509StoreName] The local + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local * certificate store location. Possible values include: 'AddressBook', * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', * 'TrustedPeople', 'TrustedPublisher' * - * @param {array} [clusterUpdateParameters.nodeTypes] The list of node types in - * the cluster. This will overwrite the existing list. - * - * @param {object} [clusterUpdateParameters.upgradeDescription] The policy to - * use when upgrading the cluster. + * @param {object} [parameters.upgradeDescription] The policy to use when + * upgrading the cluster. * - * @param {boolean} [clusterUpdateParameters.upgradeDescription.forceRestart] - * If true, then processes are forcefully restarted during upgrade even when - * the code version has not changed (the upgrade only changes configuration or - * data). + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of * availability loss issues. The timeout is reset at the start of each upgrade * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckWaitDuration The + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The * length of time to wait after completing an upgrade domain before performing * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms * format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckStableDuration The + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The * amount of time that the application or cluster must remain healthy before * the upgrade proceeds to the next upgrade domain. The duration can be in * either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckRetryTimeout The + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The * amount of time to retry health evaluation when the application or cluster is * unhealthy before the upgrade rolls back. The timeout can be in either * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} clusterUpdateParameters.upgradeDescription.upgradeTimeout - * The amount of time the overall upgrade has to complete before the upgrade - * rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms - * format. + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The + * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} clusterUpdateParameters.upgradeDescription.healthPolicy The - * cluster health policy used when upgrading the cluster. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] - * The maximum allowed percentage of unhealthy nodes before reporting an error. - * For example, to allow 10% of nodes to be unhealthy, this value would be 10. + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * maximum allowed percentage of unhealthy nodes before reporting an error. For + * example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * * * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this value * would be 10. * + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + * * @param {object} - * [clusterUpdateParameters.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * + * + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. + * + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. * - * @param {array} [clusterUpdateParameters.addOnFeatures] The list of add-on - * features to enable in the cluster. + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' * - * @param {object} [clusterUpdateParameters.tags] Cluster update parameters + * @param {object} [parameters.tags] Cluster update parameters * * @param {object} [options] Optional Parameters. * @@ -2573,11 +2931,11 @@ class Clusters { * * @reject {Error} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName, clusterName, clusterUpdateParameters, options) { + updateWithHttpOperationResponse(resourceGroupName, clusterName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._update(resourceGroupName, clusterName, clusterUpdateParameters, options, (err, result, request, response) => { + self._update(resourceGroupName, clusterName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -2588,167 +2946,221 @@ class Clusters { } /** - * @summary Update cluster configuration - * - * Update cluster configuration + * @summary Updates the configuration of a Service Fabric cluster resource. * + * Update the configuration of a Service Fabric cluster resource with the + * specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} clusterUpdateParameters The parameters which contains the - * property value and property name which used to update the cluster - * configuration. + * @param {object} parameters The parameters which contains the property value + * and property name which used to update the cluster configuration. * - * @param {string} [clusterUpdateParameters.reliabilityLevel] The reliability - * level sets the replica set size of system services. Learn about - * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). - * Possible values include: 'Bronze', 'Silver', 'Gold' + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. + * + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node + * security within the cluster, SSL certificate for cluster management endpoint + * and default admin client. + * + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the + * cluster. * - * @param {string} [clusterUpdateParameters.upgradeMode] The upgrade mode of - * the cluster. This indicates if the cluster should be automatically upgraded - * when new Service Fabric runtime version is available. Possible values - * include: 'Automatic', 'Manual' + * @param {array} [parameters.certificateCommonNames.commonNames] The list of + * server certificates referenced by common name that are used to secure the + * cluster. + * + * @param {string} [parameters.certificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' + * + * @param {array} [parameters.clientCertificateCommonNames] The list of client + * certificates referenced by common name that are allowed to manage the + * cluster. This will overwrite the existing list. * - * @param {string} [clusterUpdateParameters.clusterCodeVersion] The Service - * Fabric runtime version of the cluster. This property can only by set the - * user when **upgradeMode** is set to 'Manual'. To get list of available - * Service Fabric versions for new clusters use [ClusterVersion - * API](./ClusterVersion.md). To get the list of available version for existing - * clusters use **availableClusterVersions**. + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. This will overwrite the existing list. * - * @param {object} [clusterUpdateParameters.certificate] The certificate to use - * for securing the cluster. The certificate provided will be used for node to - * node security within the cluster, SSL certificate for cluster management - * endpoint and default admin client. + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {array} [clusterUpdateParameters.clientCertificateThumbprints] The - * list of client certificates referenced by thumbprint that are allowed to - * manage the cluster. This will overwrite the existing list. + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. This will overwrite the existing list. * - * @param {array} [clusterUpdateParameters.clientCertificateCommonNames] The - * list of client certificates referenced by common name that are allowed to - * manage the cluster. This will overwrite the existing list. + * @param {array} [parameters.nodeTypes] The list of node types in the cluster. + * This will overwrite the existing list. * - * @param {array} [clusterUpdateParameters.fabricSettings] The list of custom - * fabric settings to configure the cluster. This will overwrite the existing - * list. + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). * - * @param {object} [clusterUpdateParameters.reverseProxyCertificate] The server - * certificate used by reverse proxy. + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' * - * @param {string} clusterUpdateParameters.reverseProxyCertificate.thumbprint - * Thumbprint of the primary certificate. + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.thumbprintSecondary] + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. + * + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] * Thumbprint of the secondary certificate. * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.x509StoreName] The local + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local * certificate store location. Possible values include: 'AddressBook', * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', * 'TrustedPeople', 'TrustedPublisher' * - * @param {array} [clusterUpdateParameters.nodeTypes] The list of node types in - * the cluster. This will overwrite the existing list. - * - * @param {object} [clusterUpdateParameters.upgradeDescription] The policy to - * use when upgrading the cluster. + * @param {object} [parameters.upgradeDescription] The policy to use when + * upgrading the cluster. * - * @param {boolean} [clusterUpdateParameters.upgradeDescription.forceRestart] - * If true, then processes are forcefully restarted during upgrade even when - * the code version has not changed (the upgrade only changes configuration or - * data). + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of * availability loss issues. The timeout is reset at the start of each upgrade * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckWaitDuration The + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The * length of time to wait after completing an upgrade domain before performing * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms * format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckStableDuration The + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The * amount of time that the application or cluster must remain healthy before * the upgrade proceeds to the next upgrade domain. The duration can be in * either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckRetryTimeout The + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The * amount of time to retry health evaluation when the application or cluster is * unhealthy before the upgrade rolls back. The timeout can be in either * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} clusterUpdateParameters.upgradeDescription.upgradeTimeout - * The amount of time the overall upgrade has to complete before the upgrade - * rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms - * format. + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The + * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} clusterUpdateParameters.upgradeDescription.healthPolicy The - * cluster health policy used when upgrading the cluster. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] - * The maximum allowed percentage of unhealthy nodes before reporting an error. - * For example, to allow 10% of nodes to be unhealthy, this value would be 10. + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * maximum allowed percentage of unhealthy nodes before reporting an error. For + * example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * * * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this value * would be 10. * + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + * * @param {object} - * [clusterUpdateParameters.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * + * + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. * - * @param {array} [clusterUpdateParameters.addOnFeatures] The list of add-on - * features to enable in the cluster. + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. * - * @param {object} [clusterUpdateParameters.tags] Cluster update parameters + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' + * + * @param {object} [parameters.tags] Cluster update parameters * * @param {object} [options] Optional Parameters. * @@ -2777,7 +3189,96 @@ class Clusters { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName, clusterName, clusterUpdateParameters, options, optionalCallback) { + update(resourceGroupName, clusterName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, clusterName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, clusterName, parameters, options, optionalCallback); + } + } + + /** + * @summary Deletes a Service Fabric cluster resource. + * + * Delete a Service Fabric cluster resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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, clusterName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, clusterName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a Service Fabric cluster resource. + * + * Delete a Service Fabric cluster resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @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, clusterName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -2786,22 +3287,23 @@ class Clusters { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._update(resourceGroupName, clusterName, clusterUpdateParameters, options, (err, result, request, response) => { + self._deleteMethod(resourceGroupName, clusterName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._update(resourceGroupName, clusterName, clusterUpdateParameters, options, optionalCallback); + return self._deleteMethod(resourceGroupName, clusterName, options, optionalCallback); } } /** - * @summary List cluster resource by resource group - * - * List cluster resource by resource group + * @summary Gets the list of Service Fabric cluster resources created in the + * specified resource group. * + * Gets all Service Fabric cluster resources created or in the process of being + * created in the resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -2831,10 +3333,11 @@ class Clusters { } /** - * @summary List cluster resource by resource group - * - * List cluster resource by resource group + * @summary Gets the list of Service Fabric cluster resources created in the + * specified resource group. * + * Gets all Service Fabric cluster resources created or in the process of being + * created in the resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -2886,10 +3389,11 @@ class Clusters { } /** - * @summary List cluster resource - * - * List cluster resource + * @summary Gets the list of Service Fabric cluster resources created in the + * specified subscription. * + * Gets all Service Fabric cluster resources created or in the process of being + * created in the subscription. * * @param {object} [options] Optional Parameters. * @@ -2917,10 +3421,11 @@ class Clusters { } /** - * @summary List cluster resource - * - * List cluster resource + * @summary Gets the list of Service Fabric cluster resources created in the + * specified subscription. * + * Gets all Service Fabric cluster resources created or in the process of being + * created in the subscription. * * @param {object} [options] Optional Parameters. * @@ -2970,197 +3475,263 @@ class Clusters { } /** - * @summary Create a ServiceFabric cluster - * - * Create cluster resource + * @summary Creates or updates a Service Fabric cluster resource. * + * Create or update a Service Fabric cluster resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} cluster The cluster resource. + * @param {object} parameters The cluster resource. * - * @param {array} [cluster.availableClusterVersions] The Service Fabric runtime - * versions available for this cluster. + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. * - * @param {string} [cluster.clusterState] Possible values include: - * 'WaitingForNodes', 'Deploying', 'BaselineUpgrade', - * 'UpdatingUserConfiguration', 'UpdatingUserCertificate', - * 'UpdatingInfrastructure', 'EnforcingClusterVersion', - * 'UpgradeServiceUnreachable', 'AutoScale', 'Ready' + * @param {object} [parameters.azureActiveDirectory] The AAD authentication + * settings of the cluster. * - * @param {string} [cluster.clusterCodeVersion] The Service Fabric runtime - * version of the cluster. This property can only by set the user when - * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric - * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To - * get the list of available version for existing clusters use - * **availableClusterVersions**. + * @param {string} [parameters.azureActiveDirectory.tenantId] Azure active + * directory tenant id. * - * @param {object} [cluster.certificate] The certificate to use for securing - * the cluster. The certificate provided will be used for node to node - * security within the cluster, SSL certificate for cluster management endpoint - * and default admin client. + * @param {string} [parameters.azureActiveDirectory.clusterApplication] Azure + * active directory cluster application id. * - * @param {string} [cluster.reliabilityLevel] Possible values include: 'None', - * 'Bronze', 'Silver', 'Gold', 'Platinum' + * @param {string} [parameters.azureActiveDirectory.clientApplication] Azure + * active directory client application id. * - * @param {string} [cluster.upgradeMode] Possible values include: 'Automatic', - * 'Manual' + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node security + * within the cluster, SSL certificate for cluster management endpoint and + * default admin client. * - * @param {array} [cluster.clientCertificateThumbprints] The list of client - * certificates referenced by thumbprint that are allowed to manage the + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the * cluster. * - * @param {array} [cluster.clientCertificateCommonNames] The list of client + * @param {array} [parameters.clientCertificateCommonNames] The list of client * certificates referenced by common name that are allowed to manage the * cluster. * - * @param {array} [cluster.fabricSettings] The list of custom fabric settings - * to configure the cluster. + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. * - * @param {object} [cluster.reverseProxyCertificate] The server certificate - * used by reverse proxy. + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {string} cluster.reverseProxyCertificate.thumbprint Thumbprint of the - * primary certificate. + * @param {object} [parameters.diagnosticsStorageAccountConfig] The storage + * account information for storing Service Fabric diagnostic logs. * - * @param {string} [cluster.reverseProxyCertificate.thumbprintSecondary] - * Thumbprint of the secondary certificate. + * @param {string} + * parameters.diagnosticsStorageAccountConfig.storageAccountName The Azure + * storage account name. * - * @param {string} [cluster.reverseProxyCertificate.x509StoreName] The local - * certificate store location. Possible values include: 'AddressBook', - * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', - * 'TrustedPeople', 'TrustedPublisher' + * @param {string} + * parameters.diagnosticsStorageAccountConfig.protectedAccountKeyName The + * protected diagnostics storage key name. * - * @param {string} cluster.managementEndpoint The http management endpoint of - * the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.blobEndpoint The + * blob endpoint of the azure storage account. * - * @param {array} cluster.nodeTypes The list of node types in the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.queueEndpoint The + * queue endpoint of the azure storage account. * - * @param {object} [cluster.azureActiveDirectory] The AAD authentication - * settings of the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.tableEndpoint The + * table endpoint of the azure storage account. * - * @param {string} [cluster.azureActiveDirectory.tenantId] Azure active - * directory tenant id. + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. * - * @param {string} [cluster.azureActiveDirectory.clusterApplication] Azure - * active directory cluster application id. + * @param {string} parameters.managementEndpoint The http management endpoint + * of the cluster. * - * @param {string} [cluster.azureActiveDirectory.clientApplication] Azure - * active directory client application id. + * @param {array} parameters.nodeTypes The list of node types in the cluster. * - * @param {string} [cluster.vmImage] The VM image VMSS has been configured - * with. Generic names such as Windows or Linux can be used. + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). * - * @param {object} [cluster.diagnosticsStorageAccountConfig] The storage - * account information for storing Service Fabric diagnostic logs. + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' * - * @param {string} cluster.diagnosticsStorageAccountConfig.storageAccountName - * The Azure storage account name. + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. * - * @param {string} - * cluster.diagnosticsStorageAccountConfig.protectedAccountKeyName The - * protected diagnostics storage key name. + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. * - * @param {string} cluster.diagnosticsStorageAccountConfig.blobEndpoint The - * blob endpoint of the azure storage account. + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] + * Thumbprint of the secondary certificate. * - * @param {string} cluster.diagnosticsStorageAccountConfig.queueEndpoint The - * queue endpoint of the azure storage account. + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * @param {string} cluster.diagnosticsStorageAccountConfig.tableEndpoint The - * table endpoint of the azure storage account. + * @param {object} [parameters.reverseProxyCertificateCommonNames] Describes a + * list of server certificates referenced by common name that are used to + * secure the cluster. + * + * @param {array} [parameters.reverseProxyCertificateCommonNames.commonNames] + * The list of server certificates referenced by common name that are used to + * secure the cluster. + * + * @param {string} + * [parameters.reverseProxyCertificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * @param {object} [cluster.upgradeDescription] The policy to use when + * @param {object} [parameters.upgradeDescription] The policy to use when * upgrading the cluster. * - * @param {boolean} [cluster.upgradeDescription.forceRestart] If true, then + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then * processes are forcefully restarted during upgrade even when the code version * has not changed (the upgrade only changes configuration or data). * - * @param {string} cluster.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of * availability loss issues. The timeout is reset at the start of each upgrade * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckWaitDuration The + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The * length of time to wait after completing an upgrade domain before performing * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms * format. * - * @param {string} cluster.upgradeDescription.healthCheckStableDuration The + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The * amount of time that the application or cluster must remain healthy before * the upgrade proceeds to the next upgrade domain. The duration can be in * either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckRetryTimeout The + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The * amount of time to retry health evaluation when the application or cluster is * unhealthy before the upgrade rolls back. The timeout can be in either * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeTimeout The amount of time - * the overall upgrade has to complete before the upgrade rolls back. The + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} cluster.upgradeDescription.healthPolicy The cluster health - * policy used when upgrading the cluster. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The * maximum allowed percentage of unhealthy nodes before reporting an error. For * example, to allow 10% of nodes to be unhealthy, this value would be 10. * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * + * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this value * would be 10. * - * @param {object} [cluster.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * * - * @param {array} [cluster.addOnFeatures] The list of add-on features to enable - * in the cluster. + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. + * + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. + * + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' + * + * @param {string} [parameters.vmImage] The VM image VMSS has been configured + * with. Generic names such as Windows or Linux can be used. * - * @param {string} cluster.location Resource location. + * @param {string} parameters.location Azure resource location. * - * @param {object} [cluster.tags] Resource tags. + * @param {object} [parameters.tags] Azure resource tags. * * @param {object} [options] Optional Parameters. * @@ -3173,11 +3744,11 @@ class Clusters { * * @reject {Error} - The error object. */ - beginCreateWithHttpOperationResponse(resourceGroupName, clusterName, cluster, options) { + beginCreateWithHttpOperationResponse(resourceGroupName, clusterName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginCreate(resourceGroupName, clusterName, cluster, options, (err, result, request, response) => { + self._beginCreate(resourceGroupName, clusterName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -3188,197 +3759,263 @@ class Clusters { } /** - * @summary Create a ServiceFabric cluster - * - * Create cluster resource + * @summary Creates or updates a Service Fabric cluster resource. * + * Create or update a Service Fabric cluster resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} cluster The cluster resource. + * @param {object} parameters The cluster resource. * - * @param {array} [cluster.availableClusterVersions] The Service Fabric runtime - * versions available for this cluster. + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. * - * @param {string} [cluster.clusterState] Possible values include: - * 'WaitingForNodes', 'Deploying', 'BaselineUpgrade', - * 'UpdatingUserConfiguration', 'UpdatingUserCertificate', - * 'UpdatingInfrastructure', 'EnforcingClusterVersion', - * 'UpgradeServiceUnreachable', 'AutoScale', 'Ready' + * @param {object} [parameters.azureActiveDirectory] The AAD authentication + * settings of the cluster. * - * @param {string} [cluster.clusterCodeVersion] The Service Fabric runtime - * version of the cluster. This property can only by set the user when - * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric - * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To - * get the list of available version for existing clusters use - * **availableClusterVersions**. + * @param {string} [parameters.azureActiveDirectory.tenantId] Azure active + * directory tenant id. * - * @param {object} [cluster.certificate] The certificate to use for securing - * the cluster. The certificate provided will be used for node to node - * security within the cluster, SSL certificate for cluster management endpoint - * and default admin client. + * @param {string} [parameters.azureActiveDirectory.clusterApplication] Azure + * active directory cluster application id. * - * @param {string} [cluster.reliabilityLevel] Possible values include: 'None', - * 'Bronze', 'Silver', 'Gold', 'Platinum' + * @param {string} [parameters.azureActiveDirectory.clientApplication] Azure + * active directory client application id. * - * @param {string} [cluster.upgradeMode] Possible values include: 'Automatic', - * 'Manual' + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node security + * within the cluster, SSL certificate for cluster management endpoint and + * default admin client. * - * @param {array} [cluster.clientCertificateThumbprints] The list of client - * certificates referenced by thumbprint that are allowed to manage the + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the * cluster. * - * @param {array} [cluster.clientCertificateCommonNames] The list of client + * @param {array} [parameters.clientCertificateCommonNames] The list of client * certificates referenced by common name that are allowed to manage the * cluster. * - * @param {array} [cluster.fabricSettings] The list of custom fabric settings - * to configure the cluster. + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. * - * @param {object} [cluster.reverseProxyCertificate] The server certificate - * used by reverse proxy. + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {string} cluster.reverseProxyCertificate.thumbprint Thumbprint of the - * primary certificate. + * @param {object} [parameters.diagnosticsStorageAccountConfig] The storage + * account information for storing Service Fabric diagnostic logs. * - * @param {string} [cluster.reverseProxyCertificate.thumbprintSecondary] - * Thumbprint of the secondary certificate. + * @param {string} + * parameters.diagnosticsStorageAccountConfig.storageAccountName The Azure + * storage account name. * - * @param {string} [cluster.reverseProxyCertificate.x509StoreName] The local - * certificate store location. Possible values include: 'AddressBook', - * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', - * 'TrustedPeople', 'TrustedPublisher' + * @param {string} + * parameters.diagnosticsStorageAccountConfig.protectedAccountKeyName The + * protected diagnostics storage key name. * - * @param {string} cluster.managementEndpoint The http management endpoint of - * the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.blobEndpoint The + * blob endpoint of the azure storage account. * - * @param {array} cluster.nodeTypes The list of node types in the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.queueEndpoint The + * queue endpoint of the azure storage account. * - * @param {object} [cluster.azureActiveDirectory] The AAD authentication - * settings of the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.tableEndpoint The + * table endpoint of the azure storage account. * - * @param {string} [cluster.azureActiveDirectory.tenantId] Azure active - * directory tenant id. + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. * - * @param {string} [cluster.azureActiveDirectory.clusterApplication] Azure - * active directory cluster application id. + * @param {string} parameters.managementEndpoint The http management endpoint + * of the cluster. * - * @param {string} [cluster.azureActiveDirectory.clientApplication] Azure - * active directory client application id. + * @param {array} parameters.nodeTypes The list of node types in the cluster. * - * @param {string} [cluster.vmImage] The VM image VMSS has been configured - * with. Generic names such as Windows or Linux can be used. + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). * - * @param {object} [cluster.diagnosticsStorageAccountConfig] The storage - * account information for storing Service Fabric diagnostic logs. + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' * - * @param {string} cluster.diagnosticsStorageAccountConfig.storageAccountName - * The Azure storage account name. + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. * - * @param {string} - * cluster.diagnosticsStorageAccountConfig.protectedAccountKeyName The - * protected diagnostics storage key name. + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. * - * @param {string} cluster.diagnosticsStorageAccountConfig.blobEndpoint The - * blob endpoint of the azure storage account. + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] + * Thumbprint of the secondary certificate. * - * @param {string} cluster.diagnosticsStorageAccountConfig.queueEndpoint The - * queue endpoint of the azure storage account. + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * @param {string} cluster.diagnosticsStorageAccountConfig.tableEndpoint The - * table endpoint of the azure storage account. + * @param {object} [parameters.reverseProxyCertificateCommonNames] Describes a + * list of server certificates referenced by common name that are used to + * secure the cluster. + * + * @param {array} [parameters.reverseProxyCertificateCommonNames.commonNames] + * The list of server certificates referenced by common name that are used to + * secure the cluster. * - * @param {object} [cluster.upgradeDescription] The policy to use when + * @param {string} + * [parameters.reverseProxyCertificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' + * + * @param {object} [parameters.upgradeDescription] The policy to use when * upgrading the cluster. * - * @param {boolean} [cluster.upgradeDescription.forceRestart] If true, then + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then * processes are forcefully restarted during upgrade even when the code version * has not changed (the upgrade only changes configuration or data). * - * @param {string} cluster.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of * availability loss issues. The timeout is reset at the start of each upgrade * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckWaitDuration The + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The * length of time to wait after completing an upgrade domain before performing * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms * format. * - * @param {string} cluster.upgradeDescription.healthCheckStableDuration The + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The * amount of time that the application or cluster must remain healthy before * the upgrade proceeds to the next upgrade domain. The duration can be in * either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckRetryTimeout The + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The * amount of time to retry health evaluation when the application or cluster is * unhealthy before the upgrade rolls back. The timeout can be in either * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeTimeout The amount of time - * the overall upgrade has to complete before the upgrade rolls back. The + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} cluster.upgradeDescription.healthPolicy The cluster health - * policy used when upgrading the cluster. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The * maximum allowed percentage of unhealthy nodes before reporting an error. For * example, to allow 10% of nodes to be unhealthy, this value would be 10. * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * + * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this value * would be 10. * - * @param {object} [cluster.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. * - * @param {array} [cluster.addOnFeatures] The list of add-on features to enable - * in the cluster. * - * @param {string} cluster.location Resource location. + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. + * + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. + * + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' + * + * @param {string} [parameters.vmImage] The VM image VMSS has been configured + * with. Generic names such as Windows or Linux can be used. + * + * @param {string} parameters.location Azure resource location. * - * @param {object} [cluster.tags] Resource tags. + * @param {object} [parameters.tags] Azure resource tags. * * @param {object} [options] Optional Parameters. * @@ -3407,7 +4044,7 @@ class Clusters { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginCreate(resourceGroupName, clusterName, cluster, options, optionalCallback) { + beginCreate(resourceGroupName, clusterName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3416,179 +4053,233 @@ class Clusters { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginCreate(resourceGroupName, clusterName, cluster, options, (err, result, request, response) => { + self._beginCreate(resourceGroupName, clusterName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginCreate(resourceGroupName, clusterName, cluster, options, optionalCallback); + return self._beginCreate(resourceGroupName, clusterName, parameters, options, optionalCallback); } } /** - * @summary Update cluster configuration - * - * Update cluster configuration + * @summary Updates the configuration of a Service Fabric cluster resource. * + * Update the configuration of a Service Fabric cluster resource with the + * specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} clusterUpdateParameters The parameters which contains the - * property value and property name which used to update the cluster - * configuration. + * @param {object} parameters The parameters which contains the property value + * and property name which used to update the cluster configuration. * - * @param {string} [clusterUpdateParameters.reliabilityLevel] The reliability - * level sets the replica set size of system services. Learn about - * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). - * Possible values include: 'Bronze', 'Silver', 'Gold' + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. + * + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node + * security within the cluster, SSL certificate for cluster management endpoint + * and default admin client. + * + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the + * cluster. + * + * @param {array} [parameters.certificateCommonNames.commonNames] The list of + * server certificates referenced by common name that are used to secure the + * cluster. * - * @param {string} [clusterUpdateParameters.upgradeMode] The upgrade mode of - * the cluster. This indicates if the cluster should be automatically upgraded - * when new Service Fabric runtime version is available. Possible values - * include: 'Automatic', 'Manual' + * @param {string} [parameters.certificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' + * + * @param {array} [parameters.clientCertificateCommonNames] The list of client + * certificates referenced by common name that are allowed to manage the + * cluster. This will overwrite the existing list. + * + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. This will overwrite the existing list. * - * @param {string} [clusterUpdateParameters.clusterCodeVersion] The Service - * Fabric runtime version of the cluster. This property can only by set the - * user when **upgradeMode** is set to 'Manual'. To get list of available - * Service Fabric versions for new clusters use [ClusterVersion - * API](./ClusterVersion.md). To get the list of available version for existing - * clusters use **availableClusterVersions**. + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {object} [clusterUpdateParameters.certificate] The certificate to use - * for securing the cluster. The certificate provided will be used for node to - * node security within the cluster, SSL certificate for cluster management - * endpoint and default admin client. + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. This will overwrite the existing list. * - * @param {array} [clusterUpdateParameters.clientCertificateThumbprints] The - * list of client certificates referenced by thumbprint that are allowed to - * manage the cluster. This will overwrite the existing list. + * @param {array} [parameters.nodeTypes] The list of node types in the cluster. + * This will overwrite the existing list. * - * @param {array} [clusterUpdateParameters.clientCertificateCommonNames] The - * list of client certificates referenced by common name that are allowed to - * manage the cluster. This will overwrite the existing list. + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). * - * @param {array} [clusterUpdateParameters.fabricSettings] The list of custom - * fabric settings to configure the cluster. This will overwrite the existing - * list. + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' * - * @param {object} [clusterUpdateParameters.reverseProxyCertificate] The server - * certificate used by reverse proxy. + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. * - * @param {string} clusterUpdateParameters.reverseProxyCertificate.thumbprint - * Thumbprint of the primary certificate. + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.thumbprintSecondary] + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] * Thumbprint of the secondary certificate. * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.x509StoreName] The local + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local * certificate store location. Possible values include: 'AddressBook', * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', * 'TrustedPeople', 'TrustedPublisher' * - * @param {array} [clusterUpdateParameters.nodeTypes] The list of node types in - * the cluster. This will overwrite the existing list. - * - * @param {object} [clusterUpdateParameters.upgradeDescription] The policy to - * use when upgrading the cluster. + * @param {object} [parameters.upgradeDescription] The policy to use when + * upgrading the cluster. * - * @param {boolean} [clusterUpdateParameters.upgradeDescription.forceRestart] - * If true, then processes are forcefully restarted during upgrade even when - * the code version has not changed (the upgrade only changes configuration or - * data). + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of * availability loss issues. The timeout is reset at the start of each upgrade * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckWaitDuration The + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The * length of time to wait after completing an upgrade domain before performing * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms * format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckStableDuration The + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The * amount of time that the application or cluster must remain healthy before * the upgrade proceeds to the next upgrade domain. The duration can be in * either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckRetryTimeout The + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The * amount of time to retry health evaluation when the application or cluster is * unhealthy before the upgrade rolls back. The timeout can be in either * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} clusterUpdateParameters.upgradeDescription.upgradeTimeout - * The amount of time the overall upgrade has to complete before the upgrade - * rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms - * format. + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The + * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} clusterUpdateParameters.upgradeDescription.healthPolicy The - * cluster health policy used when upgrading the cluster. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] - * The maximum allowed percentage of unhealthy nodes before reporting an error. - * For example, to allow 10% of nodes to be unhealthy, this value would be 10. + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * maximum allowed percentage of unhealthy nodes before reporting an error. For + * example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * * * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this value * would be 10. * + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + * * @param {object} - * [clusterUpdateParameters.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * * - * @param {array} [clusterUpdateParameters.addOnFeatures] The list of add-on - * features to enable in the cluster. + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. + * + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. * - * @param {object} [clusterUpdateParameters.tags] Cluster update parameters + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' + * + * @param {object} [parameters.tags] Cluster update parameters * * @param {object} [options] Optional Parameters. * @@ -3601,11 +4292,11 @@ class Clusters { * * @reject {Error} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName, clusterName, clusterUpdateParameters, options) { + beginUpdateWithHttpOperationResponse(resourceGroupName, clusterName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, clusterName, clusterUpdateParameters, options, (err, result, request, response) => { + self._beginUpdate(resourceGroupName, clusterName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -3616,167 +4307,221 @@ class Clusters { } /** - * @summary Update cluster configuration - * - * Update cluster configuration + * @summary Updates the configuration of a Service Fabric cluster resource. * + * Update the configuration of a Service Fabric cluster resource with the + * specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} clusterUpdateParameters The parameters which contains the - * property value and property name which used to update the cluster - * configuration. + * @param {object} parameters The parameters which contains the property value + * and property name which used to update the cluster configuration. * - * @param {string} [clusterUpdateParameters.reliabilityLevel] The reliability - * level sets the replica set size of system services. Learn about - * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). - * Possible values include: 'Bronze', 'Silver', 'Gold' + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. + * + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node + * security within the cluster, SSL certificate for cluster management endpoint + * and default admin client. + * + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the + * cluster. * - * @param {string} [clusterUpdateParameters.upgradeMode] The upgrade mode of - * the cluster. This indicates if the cluster should be automatically upgraded - * when new Service Fabric runtime version is available. Possible values - * include: 'Automatic', 'Manual' + * @param {array} [parameters.certificateCommonNames.commonNames] The list of + * server certificates referenced by common name that are used to secure the + * cluster. * - * @param {string} [clusterUpdateParameters.clusterCodeVersion] The Service - * Fabric runtime version of the cluster. This property can only by set the - * user when **upgradeMode** is set to 'Manual'. To get list of available - * Service Fabric versions for new clusters use [ClusterVersion - * API](./ClusterVersion.md). To get the list of available version for existing - * clusters use **availableClusterVersions**. + * @param {string} [parameters.certificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * @param {object} [clusterUpdateParameters.certificate] The certificate to use - * for securing the cluster. The certificate provided will be used for node to - * node security within the cluster, SSL certificate for cluster management - * endpoint and default admin client. + * @param {array} [parameters.clientCertificateCommonNames] The list of client + * certificates referenced by common name that are allowed to manage the + * cluster. This will overwrite the existing list. * - * @param {array} [clusterUpdateParameters.clientCertificateThumbprints] The - * list of client certificates referenced by thumbprint that are allowed to - * manage the cluster. This will overwrite the existing list. + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. This will overwrite the existing list. * - * @param {array} [clusterUpdateParameters.clientCertificateCommonNames] The - * list of client certificates referenced by common name that are allowed to - * manage the cluster. This will overwrite the existing list. + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {array} [clusterUpdateParameters.fabricSettings] The list of custom - * fabric settings to configure the cluster. This will overwrite the existing - * list. + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. This will overwrite the existing list. * - * @param {object} [clusterUpdateParameters.reverseProxyCertificate] The server - * certificate used by reverse proxy. + * @param {array} [parameters.nodeTypes] The list of node types in the cluster. + * This will overwrite the existing list. * - * @param {string} clusterUpdateParameters.reverseProxyCertificate.thumbprint - * Thumbprint of the primary certificate. + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.thumbprintSecondary] + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' + * + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. + * + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. + * + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] * Thumbprint of the secondary certificate. * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.x509StoreName] The local + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local * certificate store location. Possible values include: 'AddressBook', * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', * 'TrustedPeople', 'TrustedPublisher' * - * @param {array} [clusterUpdateParameters.nodeTypes] The list of node types in - * the cluster. This will overwrite the existing list. - * - * @param {object} [clusterUpdateParameters.upgradeDescription] The policy to - * use when upgrading the cluster. + * @param {object} [parameters.upgradeDescription] The policy to use when + * upgrading the cluster. * - * @param {boolean} [clusterUpdateParameters.upgradeDescription.forceRestart] - * If true, then processes are forcefully restarted during upgrade even when - * the code version has not changed (the upgrade only changes configuration or - * data). + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of * availability loss issues. The timeout is reset at the start of each upgrade * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckWaitDuration The + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The * length of time to wait after completing an upgrade domain before performing * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms * format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckStableDuration The + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The * amount of time that the application or cluster must remain healthy before * the upgrade proceeds to the next upgrade domain. The duration can be in * either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckRetryTimeout The + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The * amount of time to retry health evaluation when the application or cluster is * unhealthy before the upgrade rolls back. The timeout can be in either * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} clusterUpdateParameters.upgradeDescription.upgradeTimeout - * The amount of time the overall upgrade has to complete before the upgrade - * rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms - * format. + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The + * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} clusterUpdateParameters.upgradeDescription.healthPolicy The - * cluster health policy used when upgrading the cluster. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] - * The maximum allowed percentage of unhealthy nodes before reporting an error. - * For example, to allow 10% of nodes to be unhealthy, this value would be 10. + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * maximum allowed percentage of unhealthy nodes before reporting an error. For + * example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * * * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this value * would be 10. * + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + * * @param {object} - * [clusterUpdateParameters.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * + * + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. + * + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. * - * @param {array} [clusterUpdateParameters.addOnFeatures] The list of add-on - * features to enable in the cluster. + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' * - * @param {object} [clusterUpdateParameters.tags] Cluster update parameters + * @param {object} [parameters.tags] Cluster update parameters * * @param {object} [options] Optional Parameters. * @@ -3805,7 +4550,7 @@ class Clusters { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName, clusterName, clusterUpdateParameters, options, optionalCallback) { + beginUpdate(resourceGroupName, clusterName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -3814,14 +4559,14 @@ class Clusters { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginUpdate(resourceGroupName, clusterName, clusterUpdateParameters, options, (err, result, request, response) => { + self._beginUpdate(resourceGroupName, clusterName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginUpdate(resourceGroupName, clusterName, clusterUpdateParameters, options, optionalCallback); + return self._beginUpdate(resourceGroupName, clusterName, parameters, options, optionalCallback); } } diff --git a/lib/services/serviceFabricManagement/lib/operations/index.d.ts b/lib/services/serviceFabricManagement/lib/operations/index.d.ts index 4bfe7d2cd4..cec6ba0106 100644 --- a/lib/services/serviceFabricManagement/lib/operations/index.d.ts +++ b/lib/services/serviceFabricManagement/lib/operations/index.d.ts @@ -22,197 +22,328 @@ export interface Clusters { /** - * @summary Create a ServiceFabric cluster + * @summary Gets a Service Fabric cluster resource. * - * Create cluster resource + * Get a Service Fabric cluster resource created or in the process of being + * created in the specified resource group. * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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, clusterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a Service Fabric cluster resource. + * + * Get a Service Fabric cluster resource created or in the process of being + * created in the specified resource group. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} cluster The cluster resource. + * @param {object} [options] Optional Parameters. * - * @param {array} [cluster.availableClusterVersions] The Service Fabric runtime - * versions available for this cluster. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [cluster.clusterState] Possible values include: - * 'WaitingForNodes', 'Deploying', 'BaselineUpgrade', - * 'UpdatingUserConfiguration', 'UpdatingUserCertificate', - * 'UpdatingInfrastructure', 'EnforcingClusterVersion', - * 'UpgradeServiceUnreachable', 'AutoScale', 'Ready' + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} [cluster.clusterCodeVersion] The Service Fabric runtime - * version of the cluster. This property can only by set the user when - * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric - * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To - * get the list of available version for existing clusters use - * **availableClusterVersions**. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {object} [cluster.certificate] The certificate to use for securing - * the cluster. The certificate provided will be used for node to node - * security within the cluster, SSL certificate for cluster management endpoint - * and default admin client. + * {Promise} A promise is returned. * - * @param {string} [cluster.reliabilityLevel] Possible values include: 'None', - * 'Bronze', 'Silver', 'Gold', 'Platinum' + * @resolve {Cluster} - The deserialized result object. * - * @param {string} [cluster.upgradeMode] Possible values include: 'Automatic', - * 'Manual' + * @reject {Error|ServiceError} - The error object. * - * @param {array} [cluster.clientCertificateThumbprints] The list of client - * certificates referenced by thumbprint that are allowed to manage the - * cluster. + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {array} [cluster.clientCertificateCommonNames] The list of client - * certificates referenced by common name that are allowed to manage the - * cluster. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {array} [cluster.fabricSettings] The list of custom fabric settings - * to configure the cluster. + * {Cluster} [result] - The deserialized result object if an error did not occur. + * See {@link Cluster} for more information. * - * @param {object} [cluster.reverseProxyCertificate] The server certificate - * used by reverse proxy. + * {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, clusterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, clusterName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, clusterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates or updates a Service Fabric cluster resource. * - * @param {string} cluster.reverseProxyCertificate.thumbprint Thumbprint of the - * primary certificate. + * Create or update a Service Fabric cluster resource with the specified name. * - * @param {string} [cluster.reverseProxyCertificate.thumbprintSecondary] - * Thumbprint of the secondary certificate. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [cluster.reverseProxyCertificate.x509StoreName] The local - * certificate store location. Possible values include: 'AddressBook', - * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', - * 'TrustedPeople', 'TrustedPublisher' + * @param {string} clusterName The name of the cluster resource. * - * @param {string} cluster.managementEndpoint The http management endpoint of - * the cluster. + * @param {object} parameters The cluster resource. * - * @param {array} cluster.nodeTypes The list of node types in the cluster. + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. * - * @param {object} [cluster.azureActiveDirectory] The AAD authentication + * @param {object} [parameters.azureActiveDirectory] The AAD authentication * settings of the cluster. * - * @param {string} [cluster.azureActiveDirectory.tenantId] Azure active + * @param {string} [parameters.azureActiveDirectory.tenantId] Azure active * directory tenant id. * - * @param {string} [cluster.azureActiveDirectory.clusterApplication] Azure + * @param {string} [parameters.azureActiveDirectory.clusterApplication] Azure * active directory cluster application id. * - * @param {string} [cluster.azureActiveDirectory.clientApplication] Azure + * @param {string} [parameters.azureActiveDirectory.clientApplication] Azure * active directory client application id. * - * @param {string} [cluster.vmImage] The VM image VMSS has been configured - * with. Generic names such as Windows or Linux can be used. + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node security + * within the cluster, SSL certificate for cluster management endpoint and + * default admin client. + * + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the + * cluster. + * + * @param {array} [parameters.clientCertificateCommonNames] The list of client + * certificates referenced by common name that are allowed to manage the + * cluster. + * + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. + * + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {object} [cluster.diagnosticsStorageAccountConfig] The storage + * @param {object} [parameters.diagnosticsStorageAccountConfig] The storage * account information for storing Service Fabric diagnostic logs. * - * @param {string} cluster.diagnosticsStorageAccountConfig.storageAccountName - * The Azure storage account name. + * @param {string} + * parameters.diagnosticsStorageAccountConfig.storageAccountName The Azure + * storage account name. * * @param {string} - * cluster.diagnosticsStorageAccountConfig.protectedAccountKeyName The + * parameters.diagnosticsStorageAccountConfig.protectedAccountKeyName The * protected diagnostics storage key name. * - * @param {string} cluster.diagnosticsStorageAccountConfig.blobEndpoint The + * @param {string} parameters.diagnosticsStorageAccountConfig.blobEndpoint The * blob endpoint of the azure storage account. * - * @param {string} cluster.diagnosticsStorageAccountConfig.queueEndpoint The + * @param {string} parameters.diagnosticsStorageAccountConfig.queueEndpoint The * queue endpoint of the azure storage account. * - * @param {string} cluster.diagnosticsStorageAccountConfig.tableEndpoint The + * @param {string} parameters.diagnosticsStorageAccountConfig.tableEndpoint The * table endpoint of the azure storage account. * - * @param {object} [cluster.upgradeDescription] The policy to use when + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. + * + * @param {string} parameters.managementEndpoint The http management endpoint + * of the cluster. + * + * @param {array} parameters.nodeTypes The list of node types in the cluster. + * + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). + * + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' + * + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. + * + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. + * + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] + * Thumbprint of the secondary certificate. + * + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' + * + * @param {object} [parameters.reverseProxyCertificateCommonNames] Describes a + * list of server certificates referenced by common name that are used to + * secure the cluster. + * + * @param {array} [parameters.reverseProxyCertificateCommonNames.commonNames] + * The list of server certificates referenced by common name that are used to + * secure the cluster. + * + * @param {string} + * [parameters.reverseProxyCertificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' + * + * @param {object} [parameters.upgradeDescription] The policy to use when * upgrading the cluster. * - * @param {boolean} [cluster.upgradeDescription.forceRestart] If true, then + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then * processes are forcefully restarted during upgrade even when the code version * has not changed (the upgrade only changes configuration or data). * - * @param {string} cluster.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of * availability loss issues. The timeout is reset at the start of each upgrade * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckWaitDuration The + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The * length of time to wait after completing an upgrade domain before performing * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms * format. * - * @param {string} cluster.upgradeDescription.healthCheckStableDuration The + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The * amount of time that the application or cluster must remain healthy before * the upgrade proceeds to the next upgrade domain. The duration can be in * either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckRetryTimeout The + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The * amount of time to retry health evaluation when the application or cluster is * unhealthy before the upgrade rolls back. The timeout can be in either * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeTimeout The amount of time - * the overall upgrade has to complete before the upgrade rolls back. The + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} cluster.upgradeDescription.healthPolicy The cluster health - * policy used when upgrading the cluster. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The * maximum allowed percentage of unhealthy nodes before reporting an error. For * example, to allow 10% of nodes to be unhealthy, this value would be 10. * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * + * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this value * would be 10. * - * @param {object} [cluster.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * + * + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. + * + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. + * + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' * - * @param {array} [cluster.addOnFeatures] The list of add-on features to enable - * in the cluster. + * @param {string} [parameters.vmImage] The VM image VMSS has been configured + * with. Generic names such as Windows or Linux can be used. * - * @param {string} cluster.location Resource location. + * @param {string} parameters.location Azure resource location. * - * @param {object} [cluster.tags] Resource tags. + * @param {object} [parameters.tags] Azure resource tags. * * @param {object} [options] Optional Parameters. * @@ -225,200 +356,266 @@ export interface Clusters { * * @reject {Error|ServiceError} - The error object. */ - createWithHttpOperationResponse(resourceGroupName: string, clusterName: string, cluster: models.Cluster, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createWithHttpOperationResponse(resourceGroupName: string, clusterName: string, parameters: models.Cluster, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Create a ServiceFabric cluster - * - * Create cluster resource + * @summary Creates or updates a Service Fabric cluster resource. * + * Create or update a Service Fabric cluster resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} cluster The cluster resource. + * @param {object} parameters The cluster resource. * - * @param {array} [cluster.availableClusterVersions] The Service Fabric runtime - * versions available for this cluster. + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. * - * @param {string} [cluster.clusterState] Possible values include: - * 'WaitingForNodes', 'Deploying', 'BaselineUpgrade', - * 'UpdatingUserConfiguration', 'UpdatingUserCertificate', - * 'UpdatingInfrastructure', 'EnforcingClusterVersion', - * 'UpgradeServiceUnreachable', 'AutoScale', 'Ready' + * @param {object} [parameters.azureActiveDirectory] The AAD authentication + * settings of the cluster. * - * @param {string} [cluster.clusterCodeVersion] The Service Fabric runtime - * version of the cluster. This property can only by set the user when - * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric - * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To - * get the list of available version for existing clusters use - * **availableClusterVersions**. + * @param {string} [parameters.azureActiveDirectory.tenantId] Azure active + * directory tenant id. * - * @param {object} [cluster.certificate] The certificate to use for securing - * the cluster. The certificate provided will be used for node to node - * security within the cluster, SSL certificate for cluster management endpoint - * and default admin client. + * @param {string} [parameters.azureActiveDirectory.clusterApplication] Azure + * active directory cluster application id. * - * @param {string} [cluster.reliabilityLevel] Possible values include: 'None', - * 'Bronze', 'Silver', 'Gold', 'Platinum' + * @param {string} [parameters.azureActiveDirectory.clientApplication] Azure + * active directory client application id. * - * @param {string} [cluster.upgradeMode] Possible values include: 'Automatic', - * 'Manual' + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node security + * within the cluster, SSL certificate for cluster management endpoint and + * default admin client. * - * @param {array} [cluster.clientCertificateThumbprints] The list of client - * certificates referenced by thumbprint that are allowed to manage the + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the * cluster. * - * @param {array} [cluster.clientCertificateCommonNames] The list of client + * @param {array} [parameters.clientCertificateCommonNames] The list of client * certificates referenced by common name that are allowed to manage the * cluster. * - * @param {array} [cluster.fabricSettings] The list of custom fabric settings - * to configure the cluster. + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. * - * @param {object} [cluster.reverseProxyCertificate] The server certificate - * used by reverse proxy. + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {string} cluster.reverseProxyCertificate.thumbprint Thumbprint of the - * primary certificate. + * @param {object} [parameters.diagnosticsStorageAccountConfig] The storage + * account information for storing Service Fabric diagnostic logs. * - * @param {string} [cluster.reverseProxyCertificate.thumbprintSecondary] - * Thumbprint of the secondary certificate. + * @param {string} + * parameters.diagnosticsStorageAccountConfig.storageAccountName The Azure + * storage account name. * - * @param {string} [cluster.reverseProxyCertificate.x509StoreName] The local - * certificate store location. Possible values include: 'AddressBook', - * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', - * 'TrustedPeople', 'TrustedPublisher' + * @param {string} + * parameters.diagnosticsStorageAccountConfig.protectedAccountKeyName The + * protected diagnostics storage key name. * - * @param {string} cluster.managementEndpoint The http management endpoint of - * the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.blobEndpoint The + * blob endpoint of the azure storage account. * - * @param {array} cluster.nodeTypes The list of node types in the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.queueEndpoint The + * queue endpoint of the azure storage account. * - * @param {object} [cluster.azureActiveDirectory] The AAD authentication - * settings of the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.tableEndpoint The + * table endpoint of the azure storage account. * - * @param {string} [cluster.azureActiveDirectory.tenantId] Azure active - * directory tenant id. + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. * - * @param {string} [cluster.azureActiveDirectory.clusterApplication] Azure - * active directory cluster application id. + * @param {string} parameters.managementEndpoint The http management endpoint + * of the cluster. * - * @param {string} [cluster.azureActiveDirectory.clientApplication] Azure - * active directory client application id. + * @param {array} parameters.nodeTypes The list of node types in the cluster. * - * @param {string} [cluster.vmImage] The VM image VMSS has been configured - * with. Generic names such as Windows or Linux can be used. + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). * - * @param {object} [cluster.diagnosticsStorageAccountConfig] The storage - * account information for storing Service Fabric diagnostic logs. + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' * - * @param {string} cluster.diagnosticsStorageAccountConfig.storageAccountName - * The Azure storage account name. + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. * - * @param {string} - * cluster.diagnosticsStorageAccountConfig.protectedAccountKeyName The - * protected diagnostics storage key name. + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. * - * @param {string} cluster.diagnosticsStorageAccountConfig.blobEndpoint The - * blob endpoint of the azure storage account. + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] + * Thumbprint of the secondary certificate. * - * @param {string} cluster.diagnosticsStorageAccountConfig.queueEndpoint The - * queue endpoint of the azure storage account. + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * @param {string} cluster.diagnosticsStorageAccountConfig.tableEndpoint The - * table endpoint of the azure storage account. + * @param {object} [parameters.reverseProxyCertificateCommonNames] Describes a + * list of server certificates referenced by common name that are used to + * secure the cluster. + * + * @param {array} [parameters.reverseProxyCertificateCommonNames.commonNames] + * The list of server certificates referenced by common name that are used to + * secure the cluster. + * + * @param {string} + * [parameters.reverseProxyCertificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * @param {object} [cluster.upgradeDescription] The policy to use when + * @param {object} [parameters.upgradeDescription] The policy to use when * upgrading the cluster. * - * @param {boolean} [cluster.upgradeDescription.forceRestart] If true, then + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then * processes are forcefully restarted during upgrade even when the code version * has not changed (the upgrade only changes configuration or data). * - * @param {string} cluster.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of * availability loss issues. The timeout is reset at the start of each upgrade * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckWaitDuration The + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The * length of time to wait after completing an upgrade domain before performing * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms * format. * - * @param {string} cluster.upgradeDescription.healthCheckStableDuration The + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The * amount of time that the application or cluster must remain healthy before * the upgrade proceeds to the next upgrade domain. The duration can be in * either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckRetryTimeout The + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The * amount of time to retry health evaluation when the application or cluster is * unhealthy before the upgrade rolls back. The timeout can be in either * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeTimeout The amount of time - * the overall upgrade has to complete before the upgrade rolls back. The + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} cluster.upgradeDescription.healthPolicy The cluster health - * policy used when upgrading the cluster. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The * maximum allowed percentage of unhealthy nodes before reporting an error. For * example, to allow 10% of nodes to be unhealthy, this value would be 10. * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * + * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this value * would be 10. * - * @param {object} [cluster.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * + * + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. + * + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. + * + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' * - * @param {array} [cluster.addOnFeatures] The list of add-on features to enable - * in the cluster. + * @param {string} [parameters.vmImage] The VM image VMSS has been configured + * with. Generic names such as Windows or Linux can be used. * - * @param {string} cluster.location Resource location. + * @param {string} parameters.location Azure resource location. * - * @param {object} [cluster.tags] Resource tags. + * @param {object} [parameters.tags] Azure resource tags. * * @param {object} [options] Optional Parameters. * @@ -447,478 +644,520 @@ export interface Clusters { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - create(resourceGroupName: string, clusterName: string, cluster: models.Cluster, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - create(resourceGroupName: string, clusterName: string, cluster: models.Cluster, callback: ServiceCallback): void; - create(resourceGroupName: string, clusterName: string, cluster: models.Cluster, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + create(resourceGroupName: string, clusterName: string, parameters: models.Cluster, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(resourceGroupName: string, clusterName: string, parameters: models.Cluster, callback: ServiceCallback): void; + create(resourceGroupName: string, clusterName: string, parameters: models.Cluster, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Delete cluster resource - * - * Delete cluster resource + * @summary Updates the configuration of a Service Fabric cluster resource. * + * Update the configuration of a Service Fabric cluster resource with the + * specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters The parameters which contains the property value + * and property name which used to update the cluster configuration. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. * - * @returns {Promise} A promise is returned + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node + * security within the cluster, SSL certificate for cluster management endpoint + * and default admin client. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the + * cluster. * - * @reject {Error|ServiceError} - The error object. - */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, clusterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Delete cluster resource + * @param {array} [parameters.certificateCommonNames.commonNames] The list of + * server certificates referenced by common name that are used to secure the + * cluster. * - * Delete cluster resource + * @param {string} [parameters.certificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * + * @param {array} [parameters.clientCertificateCommonNames] The list of client + * certificates referenced by common name that are allowed to manage the + * cluster. This will overwrite the existing list. * - * @param {string} resourceGroupName The name of the resource group. + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. This will overwrite the existing list. * - * @param {string} clusterName The name of the cluster resource + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {object} [options] Optional Parameters. + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. This will overwrite the existing list. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [parameters.nodeTypes] The list of node types in the cluster. + * This will overwrite the existing list. * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' * - * {Promise} A promise is returned. + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. * - * @resolve {null} - The deserialized result object. + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. * - * @reject {Error|ServiceError} - The error object. + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] + * Thumbprint of the secondary certificate. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {object} [parameters.upgradeDescription] The policy to use when + * upgrading the cluster. * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteMethod(resourceGroupName: string, clusterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, clusterName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, clusterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get cluster resource + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The + * length of time to wait after completing an upgrade domain before performing + * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms + * format. * - * Get cluster resource + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The + * amount of time that the application or cluster must remain healthy before + * the upgrade proceeds to the next upgrade domain. The duration can be in + * either hh:mm:ss or in d.hh:mm:ss.ms format. * + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The + * amount of time to retry health evaluation when the application or cluster is + * unhealthy before the upgrade rolls back. The timeout can be in either + * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The + * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} clusterName The name of the cluster resource + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} [options] Optional Parameters. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {number} + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * maximum allowed percentage of unhealthy nodes before reporting an error. For + * example, to allow 10% of nodes to be unhealthy, this value would be 10. * - * @returns {Promise} A promise is returned + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, clusterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get cluster resource * - * Get cluster resource + * @param {number} + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * The maximum allowed percentage of unhealthy applications before reporting an + * error. For example, to allow 10% of applications to be unhealthy, this value + * would be 10. + * + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. * * - * @param {string} resourceGroupName The name of the resource group. + * @param {object} + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. * - * @param {string} clusterName The name of the cluster resource + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * - * @param {object} [options] Optional Parameters. + * @param {number} + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * The maximum allowed percentage of nodes health degradation allowed during + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request * - * @param {ServiceCallback} [optionalCallback] - The optional callback. + * @param {number} + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * The maximum allowed percentage of upgrade domain nodes health degradation + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. * - * @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. + * @param {number} + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * The maximum allowed percentage of applications health degradation allowed + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. * - * @resolve {Cluster} - The deserialized result object. * - * @reject {Error|ServiceError} - The error object. + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' * - * {Cluster} [result] - The deserialized result object if an error did not occur. - * See {@link Cluster} for more information. + * @param {object} [parameters.tags] Cluster update parameters * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {object} [options] Optional Parameters. * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + * @param {object} [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. */ - get(resourceGroupName: string, clusterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, clusterName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, clusterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - + updateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, parameters: models.ClusterUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Update cluster configuration - * - * Update cluster configuration + * @summary Updates the configuration of a Service Fabric cluster resource. * + * Update the configuration of a Service Fabric cluster resource with the + * specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} clusterUpdateParameters The parameters which contains the - * property value and property name which used to update the cluster - * configuration. + * @param {object} parameters The parameters which contains the property value + * and property name which used to update the cluster configuration. * - * @param {string} [clusterUpdateParameters.reliabilityLevel] The reliability - * level sets the replica set size of system services. Learn about - * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). - * Possible values include: 'Bronze', 'Silver', 'Gold' + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. + * + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node + * security within the cluster, SSL certificate for cluster management endpoint + * and default admin client. + * + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the + * cluster. * - * @param {string} [clusterUpdateParameters.upgradeMode] The upgrade mode of - * the cluster. This indicates if the cluster should be automatically upgraded - * when new Service Fabric runtime version is available. Possible values - * include: 'Automatic', 'Manual' + * @param {array} [parameters.certificateCommonNames.commonNames] The list of + * server certificates referenced by common name that are used to secure the + * cluster. * - * @param {string} [clusterUpdateParameters.clusterCodeVersion] The Service - * Fabric runtime version of the cluster. This property can only by set the - * user when **upgradeMode** is set to 'Manual'. To get list of available - * Service Fabric versions for new clusters use [ClusterVersion - * API](./ClusterVersion.md). To get the list of available version for existing - * clusters use **availableClusterVersions**. + * @param {string} [parameters.certificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * @param {object} [clusterUpdateParameters.certificate] The certificate to use - * for securing the cluster. The certificate provided will be used for node to - * node security within the cluster, SSL certificate for cluster management - * endpoint and default admin client. + * @param {array} [parameters.clientCertificateCommonNames] The list of client + * certificates referenced by common name that are allowed to manage the + * cluster. This will overwrite the existing list. * - * @param {array} [clusterUpdateParameters.clientCertificateThumbprints] The - * list of client certificates referenced by thumbprint that are allowed to - * manage the cluster. This will overwrite the existing list. + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. This will overwrite the existing list. * - * @param {array} [clusterUpdateParameters.clientCertificateCommonNames] The - * list of client certificates referenced by common name that are allowed to - * manage the cluster. This will overwrite the existing list. + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {array} [clusterUpdateParameters.fabricSettings] The list of custom - * fabric settings to configure the cluster. This will overwrite the existing - * list. + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. This will overwrite the existing list. * - * @param {object} [clusterUpdateParameters.reverseProxyCertificate] The server - * certificate used by reverse proxy. + * @param {array} [parameters.nodeTypes] The list of node types in the cluster. + * This will overwrite the existing list. * - * @param {string} clusterUpdateParameters.reverseProxyCertificate.thumbprint - * Thumbprint of the primary certificate. + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.thumbprintSecondary] + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' + * + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. + * + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. + * + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] * Thumbprint of the secondary certificate. * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.x509StoreName] The local + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local * certificate store location. Possible values include: 'AddressBook', * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', * 'TrustedPeople', 'TrustedPublisher' * - * @param {array} [clusterUpdateParameters.nodeTypes] The list of node types in - * the cluster. This will overwrite the existing list. - * - * @param {object} [clusterUpdateParameters.upgradeDescription] The policy to - * use when upgrading the cluster. + * @param {object} [parameters.upgradeDescription] The policy to use when + * upgrading the cluster. * - * @param {boolean} [clusterUpdateParameters.upgradeDescription.forceRestart] - * If true, then processes are forcefully restarted during upgrade even when - * the code version has not changed (the upgrade only changes configuration or - * data). + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of * availability loss issues. The timeout is reset at the start of each upgrade * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckWaitDuration The + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The * length of time to wait after completing an upgrade domain before performing * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms * format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckStableDuration The + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The * amount of time that the application or cluster must remain healthy before * the upgrade proceeds to the next upgrade domain. The duration can be in * either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckRetryTimeout The + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The * amount of time to retry health evaluation when the application or cluster is * unhealthy before the upgrade rolls back. The timeout can be in either * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} clusterUpdateParameters.upgradeDescription.upgradeTimeout - * The amount of time the overall upgrade has to complete before the upgrade - * rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms - * format. + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The + * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} clusterUpdateParameters.upgradeDescription.healthPolicy The - * cluster health policy used when upgrading the cluster. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] - * The maximum allowed percentage of unhealthy nodes before reporting an error. - * For example, to allow 10% of nodes to be unhealthy, this value would be 10. + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * maximum allowed percentage of unhealthy nodes before reporting an error. For + * example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * * * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this value * would be 10. * + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + * * @param {object} - * [clusterUpdateParameters.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. - * - * @param {array} [clusterUpdateParameters.addOnFeatures] The list of add-on - * features to enable in the cluster. - * - * @param {object} [clusterUpdateParameters.tags] Cluster update parameters - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [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(resourceGroupName: string, clusterName: string, clusterUpdateParameters: models.ClusterUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Update cluster configuration - * - * Update cluster configuration - * - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} clusterName The name of the cluster resource - * - * @param {object} clusterUpdateParameters The parameters which contains the - * property value and property name which used to update the cluster - * configuration. + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. * - * @param {string} [clusterUpdateParameters.reliabilityLevel] The reliability - * level sets the replica set size of system services. Learn about - * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). - * Possible values include: 'Bronze', 'Silver', 'Gold' - * - * @param {string} [clusterUpdateParameters.upgradeMode] The upgrade mode of - * the cluster. This indicates if the cluster should be automatically upgraded - * when new Service Fabric runtime version is available. Possible values - * include: 'Automatic', 'Manual' * - * @param {string} [clusterUpdateParameters.clusterCodeVersion] The Service - * Fabric runtime version of the cluster. This property can only by set the - * user when **upgradeMode** is set to 'Manual'. To get list of available - * Service Fabric versions for new clusters use [ClusterVersion - * API](./ClusterVersion.md). To get the list of available version for existing - * clusters use **availableClusterVersions**. + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. * - * @param {object} [clusterUpdateParameters.certificate] The certificate to use - * for securing the cluster. The certificate provided will be used for node to - * node security within the cluster, SSL certificate for cluster management - * endpoint and default admin client. + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. * - * @param {array} [clusterUpdateParameters.clientCertificateThumbprints] The - * list of client certificates referenced by thumbprint that are allowed to - * manage the cluster. This will overwrite the existing list. + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' * - * @param {array} [clusterUpdateParameters.clientCertificateCommonNames] The - * list of client certificates referenced by common name that are allowed to - * manage the cluster. This will overwrite the existing list. + * @param {object} [parameters.tags] Cluster update parameters * - * @param {array} [clusterUpdateParameters.fabricSettings] The list of custom - * fabric settings to configure the cluster. This will overwrite the existing - * list. + * @param {object} [options] Optional Parameters. * - * @param {object} [clusterUpdateParameters.reverseProxyCertificate] The server - * certificate used by reverse proxy. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} clusterUpdateParameters.reverseProxyCertificate.thumbprint - * Thumbprint of the primary certificate. + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.thumbprintSecondary] - * Thumbprint of the secondary certificate. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.x509StoreName] The local - * certificate store location. Possible values include: 'AddressBook', - * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', - * 'TrustedPeople', 'TrustedPublisher' + * {Promise} A promise is returned. * - * @param {array} [clusterUpdateParameters.nodeTypes] The list of node types in - * the cluster. This will overwrite the existing list. + * @resolve {Cluster} - The deserialized result object. * - * @param {object} [clusterUpdateParameters.upgradeDescription] The policy to - * use when upgrading the cluster. + * @reject {Error|ServiceError} - The error object. * - * @param {boolean} [clusterUpdateParameters.upgradeDescription.forceRestart] - * If true, then processes are forcefully restarted during upgrade even when - * the code version has not changed (the upgrade only changes configuration or - * data). + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of - * availability loss issues. The timeout is reset at the start of each upgrade - * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckWaitDuration The - * length of time to wait after completing an upgrade domain before performing - * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms - * format. + * {Cluster} [result] - The deserialized result object if an error did not occur. + * See {@link Cluster} for more information. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckStableDuration The - * amount of time that the application or cluster must remain healthy before - * the upgrade proceeds to the next upgrade domain. The duration can be in - * either hh:mm:ss or in d.hh:mm:ss.ms format. + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckRetryTimeout The - * amount of time to retry health evaluation when the application or cluster is - * unhealthy before the upgrade rolls back. The timeout can be in either - * hh:mm:ss or in d.hh:mm:ss.ms format. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, clusterName: string, parameters: models.ClusterUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, clusterName: string, parameters: models.ClusterUpdateParameters, callback: ServiceCallback): void; + update(resourceGroupName: string, clusterName: string, parameters: models.ClusterUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a Service Fabric cluster resource. * - * @param {string} clusterUpdateParameters.upgradeDescription.upgradeTimeout - * The amount of time the overall upgrade has to complete before the upgrade - * rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms - * format. + * Delete a Service Fabric cluster resource with the specified name. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} clusterUpdateParameters.upgradeDescription.healthPolicy The - * cluster health policy used when upgrading the cluster. + * @param {string} clusterName The name of the cluster resource. * - * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] - * The maximum allowed percentage of unhealthy nodes before reporting an error. - * For example, to allow 10% of nodes to be unhealthy, this value would be 10. + * @param {object} [options] Optional Parameters. * - * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] - * The maximum allowed percentage of unhealthy applications before reporting an - * error. For example, to allow 10% of applications to be unhealthy, this value - * would be 10. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} - * [clusterUpdateParameters.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. + * @returns {Promise} A promise is returned * - * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes - * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes - * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * @reject {Error|ServiceError} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, clusterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a Service Fabric cluster resource. * - * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications - * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * Delete a Service Fabric cluster resource with the specified name. * - * @param {array} [clusterUpdateParameters.addOnFeatures] The list of add-on - * features to enable in the cluster. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} [clusterUpdateParameters.tags] Cluster update parameters + * @param {string} clusterName The name of the cluster resource. * * @param {object} [options] Optional Parameters. * @@ -932,7 +1171,7 @@ export interface Clusters { * * {Promise} A promise is returned. * - * @resolve {Cluster} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -940,23 +1179,23 @@ export interface Clusters { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Cluster} [result] - The deserialized result object if an error did not occur. - * See {@link Cluster} for more information. + * {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. */ - update(resourceGroupName: string, clusterName: string, clusterUpdateParameters: models.ClusterUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, clusterName: string, clusterUpdateParameters: models.ClusterUpdateParameters, callback: ServiceCallback): void; - update(resourceGroupName: string, clusterName: string, clusterUpdateParameters: models.ClusterUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, clusterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, clusterName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, clusterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary List cluster resource by resource group - * - * List cluster resource by resource group + * @summary Gets the list of Service Fabric cluster resources created in the + * specified resource group. * + * Gets all Service Fabric cluster resources created or in the process of being + * created in the resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -974,10 +1213,11 @@ export interface Clusters { listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary List cluster resource by resource group - * - * List cluster resource by resource group + * @summary Gets the list of Service Fabric cluster resources created in the + * specified resource group. * + * Gets all Service Fabric cluster resources created or in the process of being + * created in the resource group. * * @param {string} resourceGroupName The name of the resource group. * @@ -1014,10 +1254,11 @@ export interface Clusters { /** - * @summary List cluster resource - * - * List cluster resource + * @summary Gets the list of Service Fabric cluster resources created in the + * specified subscription. * + * Gets all Service Fabric cluster resources created or in the process of being + * created in the subscription. * * @param {object} [options] Optional Parameters. * @@ -1033,10 +1274,11 @@ export interface Clusters { listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary List cluster resource - * - * List cluster resource + * @summary Gets the list of Service Fabric cluster resources created in the + * specified subscription. * + * Gets all Service Fabric cluster resources created or in the process of being + * created in the subscription. * * @param {object} [options] Optional Parameters. * @@ -1071,197 +1313,263 @@ export interface Clusters { /** - * @summary Create a ServiceFabric cluster - * - * Create cluster resource + * @summary Creates or updates a Service Fabric cluster resource. * + * Create or update a Service Fabric cluster resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} cluster The cluster resource. + * @param {object} parameters The cluster resource. * - * @param {array} [cluster.availableClusterVersions] The Service Fabric runtime - * versions available for this cluster. + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. * - * @param {string} [cluster.clusterState] Possible values include: - * 'WaitingForNodes', 'Deploying', 'BaselineUpgrade', - * 'UpdatingUserConfiguration', 'UpdatingUserCertificate', - * 'UpdatingInfrastructure', 'EnforcingClusterVersion', - * 'UpgradeServiceUnreachable', 'AutoScale', 'Ready' + * @param {object} [parameters.azureActiveDirectory] The AAD authentication + * settings of the cluster. * - * @param {string} [cluster.clusterCodeVersion] The Service Fabric runtime - * version of the cluster. This property can only by set the user when - * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric - * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To - * get the list of available version for existing clusters use - * **availableClusterVersions**. + * @param {string} [parameters.azureActiveDirectory.tenantId] Azure active + * directory tenant id. * - * @param {object} [cluster.certificate] The certificate to use for securing - * the cluster. The certificate provided will be used for node to node - * security within the cluster, SSL certificate for cluster management endpoint - * and default admin client. + * @param {string} [parameters.azureActiveDirectory.clusterApplication] Azure + * active directory cluster application id. * - * @param {string} [cluster.reliabilityLevel] Possible values include: 'None', - * 'Bronze', 'Silver', 'Gold', 'Platinum' + * @param {string} [parameters.azureActiveDirectory.clientApplication] Azure + * active directory client application id. * - * @param {string} [cluster.upgradeMode] Possible values include: 'Automatic', - * 'Manual' + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node security + * within the cluster, SSL certificate for cluster management endpoint and + * default admin client. * - * @param {array} [cluster.clientCertificateThumbprints] The list of client - * certificates referenced by thumbprint that are allowed to manage the + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the * cluster. * - * @param {array} [cluster.clientCertificateCommonNames] The list of client + * @param {array} [parameters.clientCertificateCommonNames] The list of client * certificates referenced by common name that are allowed to manage the * cluster. * - * @param {array} [cluster.fabricSettings] The list of custom fabric settings - * to configure the cluster. - * - * @param {object} [cluster.reverseProxyCertificate] The server certificate - * used by reverse proxy. - * - * @param {string} cluster.reverseProxyCertificate.thumbprint Thumbprint of the - * primary certificate. + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. * - * @param {string} [cluster.reverseProxyCertificate.thumbprintSecondary] - * Thumbprint of the secondary certificate. + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {string} [cluster.reverseProxyCertificate.x509StoreName] The local - * certificate store location. Possible values include: 'AddressBook', - * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', - * 'TrustedPeople', 'TrustedPublisher' + * @param {object} [parameters.diagnosticsStorageAccountConfig] The storage + * account information for storing Service Fabric diagnostic logs. * - * @param {string} cluster.managementEndpoint The http management endpoint of - * the cluster. + * @param {string} + * parameters.diagnosticsStorageAccountConfig.storageAccountName The Azure + * storage account name. * - * @param {array} cluster.nodeTypes The list of node types in the cluster. + * @param {string} + * parameters.diagnosticsStorageAccountConfig.protectedAccountKeyName The + * protected diagnostics storage key name. * - * @param {object} [cluster.azureActiveDirectory] The AAD authentication - * settings of the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.blobEndpoint The + * blob endpoint of the azure storage account. * - * @param {string} [cluster.azureActiveDirectory.tenantId] Azure active - * directory tenant id. + * @param {string} parameters.diagnosticsStorageAccountConfig.queueEndpoint The + * queue endpoint of the azure storage account. * - * @param {string} [cluster.azureActiveDirectory.clusterApplication] Azure - * active directory cluster application id. + * @param {string} parameters.diagnosticsStorageAccountConfig.tableEndpoint The + * table endpoint of the azure storage account. * - * @param {string} [cluster.azureActiveDirectory.clientApplication] Azure - * active directory client application id. + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. * - * @param {string} [cluster.vmImage] The VM image VMSS has been configured - * with. Generic names such as Windows or Linux can be used. + * @param {string} parameters.managementEndpoint The http management endpoint + * of the cluster. * - * @param {object} [cluster.diagnosticsStorageAccountConfig] The storage - * account information for storing Service Fabric diagnostic logs. + * @param {array} parameters.nodeTypes The list of node types in the cluster. * - * @param {string} cluster.diagnosticsStorageAccountConfig.storageAccountName - * The Azure storage account name. + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). * - * @param {string} - * cluster.diagnosticsStorageAccountConfig.protectedAccountKeyName The - * protected diagnostics storage key name. + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' * - * @param {string} cluster.diagnosticsStorageAccountConfig.blobEndpoint The - * blob endpoint of the azure storage account. + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. * - * @param {string} cluster.diagnosticsStorageAccountConfig.queueEndpoint The - * queue endpoint of the azure storage account. + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. * - * @param {string} cluster.diagnosticsStorageAccountConfig.tableEndpoint The - * table endpoint of the azure storage account. + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] + * Thumbprint of the secondary certificate. + * + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' + * + * @param {object} [parameters.reverseProxyCertificateCommonNames] Describes a + * list of server certificates referenced by common name that are used to + * secure the cluster. + * + * @param {array} [parameters.reverseProxyCertificateCommonNames.commonNames] + * The list of server certificates referenced by common name that are used to + * secure the cluster. + * + * @param {string} + * [parameters.reverseProxyCertificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * @param {object} [cluster.upgradeDescription] The policy to use when + * @param {object} [parameters.upgradeDescription] The policy to use when * upgrading the cluster. * - * @param {boolean} [cluster.upgradeDescription.forceRestart] If true, then + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then * processes are forcefully restarted during upgrade even when the code version * has not changed (the upgrade only changes configuration or data). * - * @param {string} cluster.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of * availability loss issues. The timeout is reset at the start of each upgrade * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckWaitDuration The + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The * length of time to wait after completing an upgrade domain before performing * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms * format. * - * @param {string} cluster.upgradeDescription.healthCheckStableDuration The + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The * amount of time that the application or cluster must remain healthy before * the upgrade proceeds to the next upgrade domain. The duration can be in * either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckRetryTimeout The + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The * amount of time to retry health evaluation when the application or cluster is * unhealthy before the upgrade rolls back. The timeout can be in either * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeTimeout The amount of time - * the overall upgrade has to complete before the upgrade rolls back. The + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} cluster.upgradeDescription.healthPolicy The cluster health - * policy used when upgrading the cluster. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The * maximum allowed percentage of unhealthy nodes before reporting an error. For * example, to allow 10% of nodes to be unhealthy, this value would be 10. * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * + * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this value * would be 10. * - * @param {object} [cluster.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * + * + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. + * + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. * - * @param {array} [cluster.addOnFeatures] The list of add-on features to enable - * in the cluster. + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' + * + * @param {string} [parameters.vmImage] The VM image VMSS has been configured + * with. Generic names such as Windows or Linux can be used. * - * @param {string} cluster.location Resource location. + * @param {string} parameters.location Azure resource location. * - * @param {object} [cluster.tags] Resource tags. + * @param {object} [parameters.tags] Azure resource tags. * * @param {object} [options] Optional Parameters. * @@ -1274,200 +1582,266 @@ export interface Clusters { * * @reject {Error|ServiceError} - The error object. */ - beginCreateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, cluster: models.Cluster, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, parameters: models.Cluster, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Create a ServiceFabric cluster - * - * Create cluster resource + * @summary Creates or updates a Service Fabric cluster resource. * + * Create or update a Service Fabric cluster resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} cluster The cluster resource. + * @param {object} parameters The cluster resource. * - * @param {array} [cluster.availableClusterVersions] The Service Fabric runtime - * versions available for this cluster. + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. * - * @param {string} [cluster.clusterState] Possible values include: - * 'WaitingForNodes', 'Deploying', 'BaselineUpgrade', - * 'UpdatingUserConfiguration', 'UpdatingUserCertificate', - * 'UpdatingInfrastructure', 'EnforcingClusterVersion', - * 'UpgradeServiceUnreachable', 'AutoScale', 'Ready' + * @param {object} [parameters.azureActiveDirectory] The AAD authentication + * settings of the cluster. * - * @param {string} [cluster.clusterCodeVersion] The Service Fabric runtime - * version of the cluster. This property can only by set the user when - * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric - * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To - * get the list of available version for existing clusters use - * **availableClusterVersions**. + * @param {string} [parameters.azureActiveDirectory.tenantId] Azure active + * directory tenant id. * - * @param {object} [cluster.certificate] The certificate to use for securing - * the cluster. The certificate provided will be used for node to node - * security within the cluster, SSL certificate for cluster management endpoint - * and default admin client. + * @param {string} [parameters.azureActiveDirectory.clusterApplication] Azure + * active directory cluster application id. * - * @param {string} [cluster.reliabilityLevel] Possible values include: 'None', - * 'Bronze', 'Silver', 'Gold', 'Platinum' + * @param {string} [parameters.azureActiveDirectory.clientApplication] Azure + * active directory client application id. * - * @param {string} [cluster.upgradeMode] Possible values include: 'Automatic', - * 'Manual' + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node security + * within the cluster, SSL certificate for cluster management endpoint and + * default admin client. * - * @param {array} [cluster.clientCertificateThumbprints] The list of client - * certificates referenced by thumbprint that are allowed to manage the + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the * cluster. * - * @param {array} [cluster.clientCertificateCommonNames] The list of client + * @param {array} [parameters.clientCertificateCommonNames] The list of client * certificates referenced by common name that are allowed to manage the * cluster. * - * @param {array} [cluster.fabricSettings] The list of custom fabric settings - * to configure the cluster. + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. * - * @param {object} [cluster.reverseProxyCertificate] The server certificate - * used by reverse proxy. + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {string} cluster.reverseProxyCertificate.thumbprint Thumbprint of the - * primary certificate. + * @param {object} [parameters.diagnosticsStorageAccountConfig] The storage + * account information for storing Service Fabric diagnostic logs. * - * @param {string} [cluster.reverseProxyCertificate.thumbprintSecondary] - * Thumbprint of the secondary certificate. + * @param {string} + * parameters.diagnosticsStorageAccountConfig.storageAccountName The Azure + * storage account name. * - * @param {string} [cluster.reverseProxyCertificate.x509StoreName] The local - * certificate store location. Possible values include: 'AddressBook', - * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', - * 'TrustedPeople', 'TrustedPublisher' + * @param {string} + * parameters.diagnosticsStorageAccountConfig.protectedAccountKeyName The + * protected diagnostics storage key name. * - * @param {string} cluster.managementEndpoint The http management endpoint of - * the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.blobEndpoint The + * blob endpoint of the azure storage account. * - * @param {array} cluster.nodeTypes The list of node types in the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.queueEndpoint The + * queue endpoint of the azure storage account. * - * @param {object} [cluster.azureActiveDirectory] The AAD authentication - * settings of the cluster. + * @param {string} parameters.diagnosticsStorageAccountConfig.tableEndpoint The + * table endpoint of the azure storage account. * - * @param {string} [cluster.azureActiveDirectory.tenantId] Azure active - * directory tenant id. + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. * - * @param {string} [cluster.azureActiveDirectory.clusterApplication] Azure - * active directory cluster application id. + * @param {string} parameters.managementEndpoint The http management endpoint + * of the cluster. * - * @param {string} [cluster.azureActiveDirectory.clientApplication] Azure - * active directory client application id. + * @param {array} parameters.nodeTypes The list of node types in the cluster. * - * @param {string} [cluster.vmImage] The VM image VMSS has been configured - * with. Generic names such as Windows or Linux can be used. + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). * - * @param {object} [cluster.diagnosticsStorageAccountConfig] The storage - * account information for storing Service Fabric diagnostic logs. + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' * - * @param {string} cluster.diagnosticsStorageAccountConfig.storageAccountName - * The Azure storage account name. + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. * - * @param {string} - * cluster.diagnosticsStorageAccountConfig.protectedAccountKeyName The - * protected diagnostics storage key name. + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. * - * @param {string} cluster.diagnosticsStorageAccountConfig.blobEndpoint The - * blob endpoint of the azure storage account. + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] + * Thumbprint of the secondary certificate. * - * @param {string} cluster.diagnosticsStorageAccountConfig.queueEndpoint The - * queue endpoint of the azure storage account. + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * @param {string} cluster.diagnosticsStorageAccountConfig.tableEndpoint The - * table endpoint of the azure storage account. + * @param {object} [parameters.reverseProxyCertificateCommonNames] Describes a + * list of server certificates referenced by common name that are used to + * secure the cluster. + * + * @param {array} [parameters.reverseProxyCertificateCommonNames.commonNames] + * The list of server certificates referenced by common name that are used to + * secure the cluster. + * + * @param {string} + * [parameters.reverseProxyCertificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * @param {object} [cluster.upgradeDescription] The policy to use when + * @param {object} [parameters.upgradeDescription] The policy to use when * upgrading the cluster. * - * @param {boolean} [cluster.upgradeDescription.forceRestart] If true, then + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then * processes are forcefully restarted during upgrade even when the code version * has not changed (the upgrade only changes configuration or data). * - * @param {string} cluster.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of * availability loss issues. The timeout is reset at the start of each upgrade * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckWaitDuration The + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The * length of time to wait after completing an upgrade domain before performing * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms * format. * - * @param {string} cluster.upgradeDescription.healthCheckStableDuration The + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The * amount of time that the application or cluster must remain healthy before * the upgrade proceeds to the next upgrade domain. The duration can be in * either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.healthCheckRetryTimeout The + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The * amount of time to retry health evaluation when the application or cluster is * unhealthy before the upgrade rolls back. The timeout can be in either * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeTimeout The amount of time - * the overall upgrade has to complete before the upgrade rolls back. The + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} cluster.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} cluster.upgradeDescription.healthPolicy The cluster health - * policy used when upgrading the cluster. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The * maximum allowed percentage of unhealthy nodes before reporting an error. For * example, to allow 10% of nodes to be unhealthy, this value would be 10. * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * + * * @param {number} - * [cluster.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this value * would be 10. * - * @param {object} [cluster.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * * * @param {number} - * cluster.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * + * + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. + * + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. * - * @param {array} [cluster.addOnFeatures] The list of add-on features to enable - * in the cluster. + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' + * + * @param {string} [parameters.vmImage] The VM image VMSS has been configured + * with. Generic names such as Windows or Linux can be used. * - * @param {string} cluster.location Resource location. + * @param {string} parameters.location Azure resource location. * - * @param {object} [cluster.tags] Resource tags. + * @param {object} [parameters.tags] Azure resource tags. * * @param {object} [options] Optional Parameters. * @@ -1496,173 +1870,227 @@ export interface Clusters { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreate(resourceGroupName: string, clusterName: string, cluster: models.Cluster, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreate(resourceGroupName: string, clusterName: string, cluster: models.Cluster, callback: ServiceCallback): void; - beginCreate(resourceGroupName: string, clusterName: string, cluster: models.Cluster, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, clusterName: string, parameters: models.Cluster, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreate(resourceGroupName: string, clusterName: string, parameters: models.Cluster, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, clusterName: string, parameters: models.Cluster, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * @summary Update cluster configuration - * - * Update cluster configuration + * @summary Updates the configuration of a Service Fabric cluster resource. * + * Update the configuration of a Service Fabric cluster resource with the + * specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} clusterUpdateParameters The parameters which contains the - * property value and property name which used to update the cluster - * configuration. + * @param {object} parameters The parameters which contains the property value + * and property name which used to update the cluster configuration. * - * @param {string} [clusterUpdateParameters.reliabilityLevel] The reliability - * level sets the replica set size of system services. Learn about - * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). - * Possible values include: 'Bronze', 'Silver', 'Gold' + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. + * + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node + * security within the cluster, SSL certificate for cluster management endpoint + * and default admin client. + * + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the + * cluster. + * + * @param {array} [parameters.certificateCommonNames.commonNames] The list of + * server certificates referenced by common name that are used to secure the + * cluster. + * + * @param {string} [parameters.certificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' + * + * @param {array} [parameters.clientCertificateCommonNames] The list of client + * certificates referenced by common name that are allowed to manage the + * cluster. This will overwrite the existing list. * - * @param {string} [clusterUpdateParameters.upgradeMode] The upgrade mode of - * the cluster. This indicates if the cluster should be automatically upgraded - * when new Service Fabric runtime version is available. Possible values - * include: 'Automatic', 'Manual' + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. This will overwrite the existing list. * - * @param {string} [clusterUpdateParameters.clusterCodeVersion] The Service - * Fabric runtime version of the cluster. This property can only by set the - * user when **upgradeMode** is set to 'Manual'. To get list of available - * Service Fabric versions for new clusters use [ClusterVersion - * API](./ClusterVersion.md). To get the list of available version for existing - * clusters use **availableClusterVersions**. + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {object} [clusterUpdateParameters.certificate] The certificate to use - * for securing the cluster. The certificate provided will be used for node to - * node security within the cluster, SSL certificate for cluster management - * endpoint and default admin client. + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. This will overwrite the existing list. * - * @param {array} [clusterUpdateParameters.clientCertificateThumbprints] The - * list of client certificates referenced by thumbprint that are allowed to - * manage the cluster. This will overwrite the existing list. + * @param {array} [parameters.nodeTypes] The list of node types in the cluster. + * This will overwrite the existing list. * - * @param {array} [clusterUpdateParameters.clientCertificateCommonNames] The - * list of client certificates referenced by common name that are allowed to - * manage the cluster. This will overwrite the existing list. + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). * - * @param {array} [clusterUpdateParameters.fabricSettings] The list of custom - * fabric settings to configure the cluster. This will overwrite the existing - * list. + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' * - * @param {object} [clusterUpdateParameters.reverseProxyCertificate] The server - * certificate used by reverse proxy. + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. * - * @param {string} clusterUpdateParameters.reverseProxyCertificate.thumbprint - * Thumbprint of the primary certificate. + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.thumbprintSecondary] + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] * Thumbprint of the secondary certificate. * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.x509StoreName] The local + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local * certificate store location. Possible values include: 'AddressBook', * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', * 'TrustedPeople', 'TrustedPublisher' * - * @param {array} [clusterUpdateParameters.nodeTypes] The list of node types in - * the cluster. This will overwrite the existing list. - * - * @param {object} [clusterUpdateParameters.upgradeDescription] The policy to - * use when upgrading the cluster. + * @param {object} [parameters.upgradeDescription] The policy to use when + * upgrading the cluster. * - * @param {boolean} [clusterUpdateParameters.upgradeDescription.forceRestart] - * If true, then processes are forcefully restarted during upgrade even when - * the code version has not changed (the upgrade only changes configuration or - * data). + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of * availability loss issues. The timeout is reset at the start of each upgrade * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckWaitDuration The + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The * length of time to wait after completing an upgrade domain before performing * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms * format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckStableDuration The + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The * amount of time that the application or cluster must remain healthy before * the upgrade proceeds to the next upgrade domain. The duration can be in * either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckRetryTimeout The + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The * amount of time to retry health evaluation when the application or cluster is * unhealthy before the upgrade rolls back. The timeout can be in either * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} clusterUpdateParameters.upgradeDescription.upgradeTimeout - * The amount of time the overall upgrade has to complete before the upgrade - * rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms - * format. + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The + * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} clusterUpdateParameters.upgradeDescription.healthPolicy The - * cluster health policy used when upgrading the cluster. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] - * The maximum allowed percentage of unhealthy nodes before reporting an error. - * For example, to allow 10% of nodes to be unhealthy, this value would be 10. + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * maximum allowed percentage of unhealthy nodes before reporting an error. For + * example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * * * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this value * would be 10. * + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + * * @param {object} - * [clusterUpdateParameters.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * * - * @param {array} [clusterUpdateParameters.addOnFeatures] The list of add-on - * features to enable in the cluster. + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. + * + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. * - * @param {object} [clusterUpdateParameters.tags] Cluster update parameters + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' + * + * @param {object} [parameters.tags] Cluster update parameters * * @param {object} [options] Optional Parameters. * @@ -1675,170 +2103,224 @@ export interface Clusters { * * @reject {Error|ServiceError} - The error object. */ - beginUpdateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, clusterUpdateParameters: models.ClusterUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, parameters: models.ClusterUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Update cluster configuration - * - * Update cluster configuration + * @summary Updates the configuration of a Service Fabric cluster resource. * + * Update the configuration of a Service Fabric cluster resource with the + * specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * - * @param {object} clusterUpdateParameters The parameters which contains the - * property value and property name which used to update the cluster - * configuration. + * @param {object} parameters The parameters which contains the property value + * and property name which used to update the cluster configuration. * - * @param {string} [clusterUpdateParameters.reliabilityLevel] The reliability - * level sets the replica set size of system services. Learn about - * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). - * Possible values include: 'Bronze', 'Silver', 'Gold' + * @param {array} [parameters.addOnFeatures] The list of add-on features to + * enable in the cluster. + * + * @param {object} [parameters.certificate] The certificate to use for securing + * the cluster. The certificate provided will be used for node to node + * security within the cluster, SSL certificate for cluster management endpoint + * and default admin client. + * + * @param {object} [parameters.certificateCommonNames] Describes a list of + * server certificates referenced by common name that are used to secure the + * cluster. * - * @param {string} [clusterUpdateParameters.upgradeMode] The upgrade mode of - * the cluster. This indicates if the cluster should be automatically upgraded - * when new Service Fabric runtime version is available. Possible values - * include: 'Automatic', 'Manual' + * @param {array} [parameters.certificateCommonNames.commonNames] The list of + * server certificates referenced by common name that are used to secure the + * cluster. * - * @param {string} [clusterUpdateParameters.clusterCodeVersion] The Service - * Fabric runtime version of the cluster. This property can only by set the - * user when **upgradeMode** is set to 'Manual'. To get list of available - * Service Fabric versions for new clusters use [ClusterVersion - * API](./ClusterVersion.md). To get the list of available version for existing - * clusters use **availableClusterVersions**. + * @param {string} [parameters.certificateCommonNames.x509StoreName] The local + * certificate store location. Possible values include: 'AddressBook', + * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', + * 'TrustedPeople', 'TrustedPublisher' * - * @param {object} [clusterUpdateParameters.certificate] The certificate to use - * for securing the cluster. The certificate provided will be used for node to - * node security within the cluster, SSL certificate for cluster management - * endpoint and default admin client. + * @param {array} [parameters.clientCertificateCommonNames] The list of client + * certificates referenced by common name that are allowed to manage the + * cluster. This will overwrite the existing list. * - * @param {array} [clusterUpdateParameters.clientCertificateThumbprints] The - * list of client certificates referenced by thumbprint that are allowed to - * manage the cluster. This will overwrite the existing list. + * @param {array} [parameters.clientCertificateThumbprints] The list of client + * certificates referenced by thumbprint that are allowed to manage the + * cluster. This will overwrite the existing list. * - * @param {array} [clusterUpdateParameters.clientCertificateCommonNames] The - * list of client certificates referenced by common name that are allowed to - * manage the cluster. This will overwrite the existing list. + * @param {string} [parameters.clusterCodeVersion] The Service Fabric runtime + * version of the cluster. This property can only by set the user when + * **upgradeMode** is set to 'Manual'. To get list of available Service Fabric + * versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To + * get the list of available version for existing clusters use + * **availableClusterVersions**. * - * @param {array} [clusterUpdateParameters.fabricSettings] The list of custom - * fabric settings to configure the cluster. This will overwrite the existing - * list. + * @param {array} [parameters.fabricSettings] The list of custom fabric + * settings to configure the cluster. This will overwrite the existing list. * - * @param {object} [clusterUpdateParameters.reverseProxyCertificate] The server - * certificate used by reverse proxy. + * @param {array} [parameters.nodeTypes] The list of node types in the cluster. + * This will overwrite the existing list. * - * @param {string} clusterUpdateParameters.reverseProxyCertificate.thumbprint - * Thumbprint of the primary certificate. + * @param {string} [parameters.reliabilityLevel] The reliability level sets the + * replica set size of system services. Learn about + * [ReliabilityLevel](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-capacity). * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.thumbprintSecondary] + * - None - Run the System services with a target replica set count of 1. This + * should only be used for test clusters. + * - Bronze - Run the System services with a target replica set count of 3. + * This should only be used for test clusters. + * - Silver - Run the System services with a target replica set count of 5. + * - Gold - Run the System services with a target replica set count of 7. + * - Platinum - Run the System services with a target replica set count of 9. + * . Possible values include: 'None', 'Bronze', 'Silver', 'Gold', 'Platinum' + * + * @param {object} [parameters.reverseProxyCertificate] The server certificate + * used by reverse proxy. + * + * @param {string} parameters.reverseProxyCertificate.thumbprint Thumbprint of + * the primary certificate. + * + * @param {string} [parameters.reverseProxyCertificate.thumbprintSecondary] * Thumbprint of the secondary certificate. * - * @param {string} - * [clusterUpdateParameters.reverseProxyCertificate.x509StoreName] The local + * @param {string} [parameters.reverseProxyCertificate.x509StoreName] The local * certificate store location. Possible values include: 'AddressBook', * 'AuthRoot', 'CertificateAuthority', 'Disallowed', 'My', 'Root', * 'TrustedPeople', 'TrustedPublisher' * - * @param {array} [clusterUpdateParameters.nodeTypes] The list of node types in - * the cluster. This will overwrite the existing list. - * - * @param {object} [clusterUpdateParameters.upgradeDescription] The policy to - * use when upgrading the cluster. + * @param {object} [parameters.upgradeDescription] The policy to use when + * upgrading the cluster. * - * @param {boolean} [clusterUpdateParameters.upgradeDescription.forceRestart] - * If true, then processes are forcefully restarted during upgrade even when - * the code version has not changed (the upgrade only changes configuration or - * data). + * @param {boolean} [parameters.upgradeDescription.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeReplicaSetCheckTimeout The - * maximum amount of time to block processing of an upgrade domain and revent - * loss of availability when there are unexpected issues. When this timeout - * expires, processing of the upgrade domain will proceed regardless of + * @param {string} parameters.upgradeDescription.upgradeReplicaSetCheckTimeout + * The maximum amount of time to block processing of an upgrade domain and + * revent loss of availability when there are unexpected issues. When this + * timeout expires, processing of the upgrade domain will proceed regardless of * availability loss issues. The timeout is reset at the start of each upgrade * domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckWaitDuration The + * @param {string} parameters.upgradeDescription.healthCheckWaitDuration The * length of time to wait after completing an upgrade domain before performing * health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms * format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckStableDuration The + * @param {string} parameters.upgradeDescription.healthCheckStableDuration The * amount of time that the application or cluster must remain healthy before * the upgrade proceeds to the next upgrade domain. The duration can be in * either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.healthCheckRetryTimeout The + * @param {string} parameters.upgradeDescription.healthCheckRetryTimeout The * amount of time to retry health evaluation when the application or cluster is * unhealthy before the upgrade rolls back. The timeout can be in either * hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} clusterUpdateParameters.upgradeDescription.upgradeTimeout - * The amount of time the overall upgrade has to complete before the upgrade - * rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms - * format. + * @param {string} parameters.upgradeDescription.upgradeTimeout The amount of + * time the overall upgrade has to complete before the upgrade rolls back. The + * timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {string} - * clusterUpdateParameters.upgradeDescription.upgradeDomainTimeout The amount - * of time each upgrade domain has to complete before the upgrade rolls back. - * The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. + * @param {string} parameters.upgradeDescription.upgradeDomainTimeout The + * amount of time each upgrade domain has to complete before the upgrade rolls + * back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. * - * @param {object} clusterUpdateParameters.upgradeDescription.healthPolicy The - * cluster health policy used when upgrading the cluster. + * @param {object} parameters.upgradeDescription.healthPolicy The cluster + * health policy used when upgrading the cluster. * * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] - * The maximum allowed percentage of unhealthy nodes before reporting an error. - * For example, to allow 10% of nodes to be unhealthy, this value would be 10. + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyNodes] The + * maximum allowed percentage of unhealthy nodes before reporting an error. For + * example, to allow 10% of nodes to be unhealthy, this value would be 10. + * + * The percentage represents the maximum tolerated percentage of nodes that can + * be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy node, the + * health is evaluated as Warning. + * The percentage is calculated by dividing the number of unhealthy nodes over + * the total number of nodes in the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * In large clusters, some nodes will always be down or out for repairs, so + * this percentage should be configured to tolerate that. + * * * @param {number} - * [clusterUpdateParameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] + * [parameters.upgradeDescription.healthPolicy.maxPercentUnhealthyApplications] * The maximum allowed percentage of unhealthy applications before reporting an * error. For example, to allow 10% of applications to be unhealthy, this value * would be 10. * + * The percentage represents the maximum tolerated percentage of applications + * that can be unhealthy before the cluster is considered in error. + * If the percentage is respected but there is at least one unhealthy + * application, the health is evaluated as Warning. + * This is calculated by dividing the number of unhealthy applications over the + * total number of application instances in the cluster, excluding applications + * of application types that are included in the + * ApplicationTypeHealthPolicyMap. + * The computation rounds up to tolerate one failure on small numbers of + * applications. Default percentage is zero. + * + * * @param {object} - * [clusterUpdateParameters.upgradeDescription.deltaHealthPolicy] The delta - * health policy used when upgrading the cluster. + * [parameters.upgradeDescription.healthPolicy.applicationHealthPolicies] + * Defines the application health policy map used to evaluate the health of an + * application or one of its children entities. + * + * @param {object} [parameters.upgradeDescription.deltaHealthPolicy] The + * cluster delta health policy used when upgrading the cluster. * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyNodes * The maximum allowed percentage of nodes health degradation allowed during - * cluster upgrades. The delta is measured between the state of the nodes at - * the beginning of upgrade and the state of the nodes at the time of the - * health evaluation. The check is performed after every upgrade domain upgrade - * completion to make sure the global state of the cluster is within tolerated - * limits. + * cluster upgrades. + * The delta is measured between the state of the nodes at the beginning of + * upgrade and the state of the nodes at the time of the health evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. + * * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentUpgradeDomainDeltaUnhealthyNodes * The maximum allowed percentage of upgrade domain nodes health degradation - * allowed during cluster upgrades. The delta is measured between the state of - * the upgrade domain nodes at the beginning of upgrade and the state of the - * upgrade domain nodes at the time of the health evaluation. The check is - * performed after every upgrade domain upgrade completion for all completed - * upgrade domains to make sure the state of the upgrade domains is within - * tolerated limits. + * allowed during cluster upgrades. + * The delta is measured between the state of the upgrade domain nodes at the + * beginning of upgrade and the state of the upgrade domain nodes at the time + * of the health evaluation. + * The check is performed after every upgrade domain upgrade completion for all + * completed upgrade domains to make sure the state of the upgrade domains is + * within tolerated limits. + * * * @param {number} - * clusterUpdateParameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications + * parameters.upgradeDescription.deltaHealthPolicy.maxPercentDeltaUnhealthyApplications * The maximum allowed percentage of applications health degradation allowed - * during cluster upgrades. The delta is measured between the state of the - * applications at the beginning of upgrade and the state of the applications - * at the time of the health evaluation. The check is performed after every - * upgrade domain upgrade completion to make sure the global state of the - * cluster is within tolerated limits. System services are not included in - * this. + * during cluster upgrades. + * The delta is measured between the state of the applications at the beginning + * of upgrade and the state of the applications at the time of the health + * evaluation. + * The check is performed after every upgrade domain upgrade completion to make + * sure the global state of the cluster is within tolerated limits. System + * services are not included in this. + * + * + * @param {object} + * [parameters.upgradeDescription.deltaHealthPolicy.applicationDeltaHealthPolicies] + * Defines the application delta health policy map used to evaluate the health + * of an application or one of its child entities when upgrading the cluster. + * + * @param {string} [parameters.upgradeMode] The upgrade mode of the cluster + * when new Service Fabric runtime version is available. * - * @param {array} [clusterUpdateParameters.addOnFeatures] The list of add-on - * features to enable in the cluster. + * - Automatic - The cluster will be automatically upgraded to the latest + * Service Fabric runtime version as soon as it is available. + * - Manual - The cluster will not be automatically upgraded to the latest + * Service Fabric runtime version. The cluster is upgraded by setting the + * **clusterCodeVersion** property in the cluster resource. + * . Possible values include: 'Automatic', 'Manual' * - * @param {object} [clusterUpdateParameters.tags] Cluster update parameters + * @param {object} [parameters.tags] Cluster update parameters * * @param {object} [options] Optional Parameters. * @@ -1867,9 +2349,9 @@ export interface Clusters { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginUpdate(resourceGroupName: string, clusterName: string, clusterUpdateParameters: models.ClusterUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginUpdate(resourceGroupName: string, clusterName: string, clusterUpdateParameters: models.ClusterUpdateParameters, callback: ServiceCallback): void; - beginUpdate(resourceGroupName: string, clusterName: string, clusterUpdateParameters: models.ClusterUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, clusterName: string, parameters: models.ClusterUpdateParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, clusterName: string, parameters: models.ClusterUpdateParameters, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, clusterName: string, parameters: models.ClusterUpdateParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** @@ -1882,15 +2364,15 @@ export interface ClusterVersions { /** - * @summary Get cluster code versions + * @summary Gets information about a Service Fabric cluster code version + * available in the specified location. * - * Get cluster code versions by location + * Gets information about an available Service Fabric cluster code version. * + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location - * - * @param {string} clusterVersion The cluster code version + * @param {string} clusterVersion The cluster code version. * * @param {object} [options] Optional Parameters. * @@ -1906,15 +2388,15 @@ export interface ClusterVersions { getWithHttpOperationResponse(location: string, clusterVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Get cluster code versions - * - * Get cluster code versions by location + * @summary Gets information about a Service Fabric cluster code version + * available in the specified location. * + * Gets information about an available Service Fabric cluster code version. * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * - * @param {string} clusterVersion The cluster code version + * @param {string} clusterVersion The cluster code version. * * @param {object} [options] Optional Parameters. * @@ -1950,18 +2432,19 @@ export interface ClusterVersions { /** - * @summary Get cluster code versions by environment + * @summary Gets information about a Service Fabric cluster code version + * available for the specified environment. * - * Get cluster code versions by environment + * Gets information about an available Service Fabric cluster code version by + * environment. * + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location + * @param {string} environment The operating system of the cluster. The default + * means all. Possible values include: 'Windows', 'Linux' * - * @param {string} environment Cluster operating system, the default means all. - * Possible values include: 'Windows', 'Linux' - * - * @param {string} clusterVersion The cluster code version + * @param {string} clusterVersion The cluster code version. * * @param {object} [options] Optional Parameters. * @@ -1977,18 +2460,19 @@ export interface ClusterVersions { getByEnvironmentWithHttpOperationResponse(location: string, environment: string, clusterVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Get cluster code versions by environment - * - * Get cluster code versions by environment + * @summary Gets information about a Service Fabric cluster code version + * available for the specified environment. * + * Gets information about an available Service Fabric cluster code version by + * environment. * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * - * @param {string} environment Cluster operating system, the default means all. - * Possible values include: 'Windows', 'Linux' + * @param {string} environment The operating system of the cluster. The default + * means all. Possible values include: 'Windows', 'Linux' * - * @param {string} clusterVersion The cluster code version + * @param {string} clusterVersion The cluster code version. * * @param {object} [options] Optional Parameters. * @@ -2024,13 +2508,14 @@ export interface ClusterVersions { /** - * @summary List cluster code versions by location + * @summary Gets the list of Service Fabric cluster code versions available for + * the specified location. * - * List cluster code versions by location + * Gets all available code versions for Service Fabric cluster resources by + * location. * - * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * * @param {object} [options] Optional Parameters. * @@ -2046,13 +2531,14 @@ export interface ClusterVersions { listWithHttpOperationResponse(location: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary List cluster code versions by location - * - * List cluster code versions by location + * @summary Gets the list of Service Fabric cluster code versions available for + * the specified location. * + * Gets all available code versions for Service Fabric cluster resources by + * location. * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * * @param {object} [options] Optional Parameters. * @@ -2088,16 +2574,17 @@ export interface ClusterVersions { /** - * @summary List cluster code versions by environment + * @summary Gets the list of Service Fabric cluster code versions available for + * the specified environment. * - * List cluster code versions by environment + * Gets all available code versions for Service Fabric cluster resources by + * environment. * + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location - * - * @param {string} environment Cluster operating system, the default means all. - * Possible values include: 'Windows', 'Linux' + * @param {string} environment The operating system of the cluster. The default + * means all. Possible values include: 'Windows', 'Linux' * * @param {object} [options] Optional Parameters. * @@ -2113,16 +2600,17 @@ export interface ClusterVersions { listByEnvironmentWithHttpOperationResponse(location: string, environment: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary List cluster code versions by environment - * - * List cluster code versions by environment + * @summary Gets the list of Service Fabric cluster code versions available for + * the specified environment. * + * Gets all available code versions for Service Fabric cluster resources by + * environment. * - * @param {string} location The location for the cluster code versions, this is - * different from cluster location + * @param {string} location The location for the cluster code versions. This is + * different from cluster location. * - * @param {string} environment Cluster operating system, the default means all. - * Possible values include: 'Windows', 'Linux' + * @param {string} environment The operating system of the cluster. The default + * means all. Possible values include: 'Windows', 'Linux' * * @param {object} [options] Optional Parameters. * @@ -2167,11 +2655,13 @@ export interface Operations { /** - * @summary Lists all of the available ServiceFabric Resource Manager REST API + * @summary Lists all of the available Service Fabric resource provider API * operations. * - * @param {string} apiVersion The version of the ServiceFabric resouce provider - * api + * Get the list of available Service Fabric resource provider API operations. + * + * @param {string} apiVersion The version of the Service Fabric resouce + * provider API * * @param {object} [options] Optional Parameters. * @@ -2187,11 +2677,13 @@ export interface Operations { listWithHttpOperationResponse(apiVersion: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Lists all of the available ServiceFabric Resource Manager REST API + * @summary Lists all of the available Service Fabric resource provider API * operations. * - * @param {string} apiVersion The version of the ServiceFabric resouce provider - * api + * Get the list of available Service Fabric resource provider API operations. + * + * @param {string} apiVersion The version of the Service Fabric resouce + * provider API * * @param {object} [options] Optional Parameters. * @@ -2226,9 +2718,11 @@ export interface Operations { /** - * @summary Lists all of the available ServiceFabric Resource Manager REST API + * @summary Lists all of the available Service Fabric resource provider API * operations. * + * Get the list of available Service Fabric resource provider API operations. + * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * @@ -2246,9 +2740,11 @@ export interface Operations { listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Lists all of the available ServiceFabric Resource Manager REST API + * @summary Lists all of the available Service Fabric resource provider API * operations. * + * Get the list of available Service Fabric resource provider API operations. + * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * @@ -2286,22 +2782,25 @@ export interface Operations { /** * @class - * ApplicationType + * ApplicationTypes * __NOTE__: An instance of this class is automatically created for an * instance of the ServiceFabricManagementClient. */ -export interface ApplicationType { +export interface ApplicationTypes { /** - * Returns an application type name resource. + * @summary Gets a Service Fabric application type name resource. + * + * Get a Service Fabric application type name resource created or in the + * process of being created in the Service Fabric cluster resource. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationTypeName The name of the application type name - * resource + * resource. * * @param {object} [options] Optional Parameters. * @@ -2317,14 +2816,17 @@ export interface ApplicationType { getWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns an application type name resource. + * @summary Gets a Service Fabric application type name resource. + * + * Get a Service Fabric application type name resource created or in the + * process of being created in the Service Fabric cluster resource. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationTypeName The name of the application type name - * resource + * resource. * * @param {object} [options] Optional Parameters. * @@ -2360,18 +2862,21 @@ export interface ApplicationType { /** - * Creates the application type name resource. + * @summary Creates or updates a Service Fabric application type name resource. + * + * Create or update a Service Fabric application type name resource with the + * specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationTypeName The name of the application type name - * resource + * resource. * * @param {object} parameters The application type name resource. * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.location] Azure resource location. * * @param {object} [options] Optional Parameters. * @@ -2384,21 +2889,24 @@ export interface ApplicationType { * * @reject {Error|ServiceError} - The error object. */ - putWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationTypeName: string, parameters: models.ApplicationTypeResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationTypeName: string, parameters: models.ApplicationTypeResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates the application type name resource. + * @summary Creates or updates a Service Fabric application type name resource. + * + * Create or update a Service Fabric application type name resource with the + * specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationTypeName The name of the application type name - * resource + * resource. * * @param {object} parameters The application type name resource. * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.location] Azure resource location. * * @param {object} [options] Optional Parameters. * @@ -2428,25 +2936,23 @@ export interface ApplicationType { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - put(resourceGroupName: string, clusterName: string, applicationTypeName: string, parameters: models.ApplicationTypeResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - put(resourceGroupName: string, clusterName: string, applicationTypeName: string, parameters: models.ApplicationTypeResource, callback: ServiceCallback): void; - put(resourceGroupName: string, clusterName: string, applicationTypeName: string, parameters: models.ApplicationTypeResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + create(resourceGroupName: string, clusterName: string, applicationTypeName: string, parameters: models.ApplicationTypeResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(resourceGroupName: string, clusterName: string, applicationTypeName: string, parameters: models.ApplicationTypeResource, callback: ServiceCallback): void; + create(resourceGroupName: string, clusterName: string, applicationTypeName: string, parameters: models.ApplicationTypeResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates the application type name resource. + * @summary Deletes a Service Fabric application type name resource. + * + * Delete a Service Fabric application type name resource with the specified + * name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationTypeName The name of the application type name - * resource - * - * @param {object} parameters The application type name resource for patch - * operations. - * - * @param {string} parameters.location Resource location. + * resource. * * @param {object} [options] Optional Parameters. * @@ -2455,26 +2961,24 @@ export interface ApplicationType { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - patchWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationTypeName: string, parameters: models.ApplicationTypeResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates the application type name resource. + * @summary Deletes a Service Fabric application type name resource. + * + * Delete a Service Fabric application type name resource with the specified + * name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationTypeName The name of the application type name - * resource - * - * @param {object} parameters The application type name resource for patch - * operations. - * - * @param {string} parameters.location Resource location. + * resource. * * @param {object} [options] Optional Parameters. * @@ -2488,7 +2992,7 @@ export interface ApplicationType { * * {Promise} A promise is returned. * - * @resolve {ApplicationTypeResource} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2496,28 +3000,27 @@ export interface ApplicationType { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ApplicationTypeResource} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationTypeResource} for more - * information. + * {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. */ - patch(resourceGroupName: string, clusterName: string, applicationTypeName: string, parameters: models.ApplicationTypeResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - patch(resourceGroupName: string, clusterName: string, applicationTypeName: string, parameters: models.ApplicationTypeResource, callback: ServiceCallback): void; - patch(resourceGroupName: string, clusterName: string, applicationTypeName: string, parameters: models.ApplicationTypeResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, clusterName: string, applicationTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, clusterName: string, applicationTypeName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, clusterName: string, applicationTypeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes the application type name resource. + * @summary Gets the list of application type name resources created in the + * specified Service Fabric cluster resource. * - * @param {string} resourceGroupName The name of the resource group. + * Gets all application type name resources created or in the process of being + * created in the Service Fabric cluster resource. * - * @param {string} clusterName The name of the cluster resource + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} applicationTypeName The name of the application type name - * resource + * @param {string} clusterName The name of the cluster resource. * * @param {object} [options] Optional Parameters. * @@ -2526,21 +3029,22 @@ export interface ApplicationType { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, clusterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes the application type name resource. + * @summary Gets the list of application type name resources created in the + * specified Service Fabric cluster resource. * - * @param {string} resourceGroupName The name of the resource group. + * Gets all application type name resources created or in the process of being + * created in the Service Fabric cluster resource. * - * @param {string} clusterName The name of the cluster resource + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} applicationTypeName The name of the application type name - * resource + * @param {string} clusterName The name of the cluster resource. * * @param {object} [options] Optional Parameters. * @@ -2554,7 +3058,7 @@ export interface ApplicationType { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ApplicationTypeResourceList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2562,23 +3066,31 @@ export interface ApplicationType { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ApplicationTypeResourceList} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationTypeResourceList} 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. */ - deleteMethod(resourceGroupName: string, clusterName: string, applicationTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, clusterName: string, applicationTypeName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, clusterName: string, applicationTypeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, clusterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, clusterName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, clusterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns all application type names in the specified cluster. + * @summary Deletes a Service Fabric application type name resource. + * + * Delete a Service Fabric application type name resource with the specified + * name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. * * @param {object} [options] Optional Parameters. * @@ -2587,18 +3099,24 @@ export interface ApplicationType { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, clusterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns all application type names in the specified cluster. + * @summary Deletes a Service Fabric application type name resource. + * + * Delete a Service Fabric application type name resource with the specified + * name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. * * @param {object} [options] Optional Parameters. * @@ -2612,7 +3130,7 @@ export interface ApplicationType { * * {Promise} A promise is returned. * - * @resolve {ApplicationTypeResourceList} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2620,37 +3138,39 @@ export interface ApplicationType { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ApplicationTypeResourceList} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationTypeResourceList} for more - * information. + * {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. */ - list(resourceGroupName: string, clusterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, clusterName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, clusterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, clusterName: string, applicationTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, clusterName: string, applicationTypeName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, clusterName: string, applicationTypeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * Version + * ApplicationTypeVersions * __NOTE__: An instance of this class is automatically created for an * instance of the ServiceFabricManagementClient. */ -export interface Version { +export interface ApplicationTypeVersions { /** - * Returns an application type version resource. + * @summary Gets a Service Fabric application type version resource. + * + * Get a Service Fabric application type version resource created or in the + * process of being created in the Service Fabric application type name + * resource. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationTypeName The name of the application type name - * resource + * resource. * * @param {string} version The application type version. * @@ -2661,21 +3181,25 @@ export interface Version { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns an application type version resource. + * @summary Gets a Service Fabric application type version resource. + * + * Get a Service Fabric application type version resource created or in the + * process of being created in the Service Fabric application type name + * resource. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationTypeName The name of the application type name - * resource + * resource. * * @param {string} version The application type version. * @@ -2691,7 +3215,7 @@ export interface Version { * * {Promise} A promise is returned. * - * @resolve {VersionResource} - The deserialized result object. + * @resolve {ApplicationTypeVersionResource} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2699,36 +3223,40 @@ export interface Version { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VersionResource} [result] - The deserialized result object if an error did not occur. - * See {@link VersionResource} for more information. + * {ApplicationTypeVersionResource} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationTypeVersionResource} 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, clusterName: string, applicationTypeName: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, callback: ServiceCallback): void; - get(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + get(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, callback: ServiceCallback): void; + get(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Provisions an application type version resource. + * @summary Creates or updates a Service Fabric application type version + * resource. + * + * Create or update a Service Fabric application type version resource with the + * specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationTypeName The name of the application type name - * resource + * resource. * * @param {string} version The application type version. * * @param {object} parameters The application type version resource. * - * @param {string} [parameters.appPackageUrl] The URL to the application - * package + * @param {string} parameters.appPackageUrl The URL to the application package * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.location] Azure resource location. * * @param {object} [options] Optional Parameters. * @@ -2737,30 +3265,33 @@ export interface Version { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - putWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, parameters: models.VersionResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + createWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, parameters: models.ApplicationTypeVersionResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Provisions an application type version resource. + * @summary Creates or updates a Service Fabric application type version + * resource. + * + * Create or update a Service Fabric application type version resource with the + * specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationTypeName The name of the application type name - * resource + * resource. * * @param {string} version The application type version. * * @param {object} parameters The application type version resource. * - * @param {string} [parameters.appPackageUrl] The URL to the application - * package + * @param {string} parameters.appPackageUrl The URL to the application package * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.location] Azure resource location. * * @param {object} [options] Optional Parameters. * @@ -2774,7 +3305,7 @@ export interface Version { * * {Promise} A promise is returned. * - * @resolve {VersionResource} - The deserialized result object. + * @resolve {ApplicationTypeVersionResource} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2782,38 +3313,34 @@ export interface Version { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VersionResource} [result] - The deserialized result object if an error did not occur. - * See {@link VersionResource} for more information. + * {ApplicationTypeVersionResource} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationTypeVersionResource} 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. */ - put(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, parameters: models.VersionResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - put(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, parameters: models.VersionResource, callback: ServiceCallback): void; - put(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, parameters: models.VersionResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + create(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, parameters: models.ApplicationTypeVersionResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, parameters: models.ApplicationTypeVersionResource, callback: ServiceCallback): void; + create(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, parameters: models.ApplicationTypeVersionResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an application type version resource. + * @summary Deletes a Service Fabric application type version resource. + * + * Delete a Service Fabric application type version resource with the specified + * name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationTypeName The name of the application type name - * resource + * resource. * * @param {string} version The application type version. * - * @param {object} parameters The application type version resource for patch - * operations. - * - * @param {string} [parameters.appPackageUrl] The URL to the application - * package - * - * @param {string} parameters.location Resource location. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2821,31 +3348,98 @@ export interface Version { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - patchWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, parameters: models.VersionResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates an application type version resource. + * @summary Deletes a Service Fabric application type version resource. + * + * Delete a Service Fabric application type version resource with the specified + * name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationTypeName The name of the application type name - * resource + * resource. * * @param {string} version The application type version. * - * @param {object} parameters The application type version resource for patch - * operations. + * @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, clusterName: string, applicationTypeName: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the list of application type version resources created in the + * specified Service Fabric application type name resource. + * + * Gets all application type version resources created or in the process of + * being created in the Service Fabric application type name resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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(resourceGroupName: string, clusterName: string, applicationTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the list of application type version resources created in the + * specified Service Fabric application type name resource. * - * @param {string} [parameters.appPackageUrl] The URL to the application - * package + * Gets all application type version resources created or in the process of + * being created in the Service Fabric application type name resource. * - * @param {string} parameters.location Resource location. + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationTypeName The name of the application type name + * resource. * * @param {object} [options] Optional Parameters. * @@ -2859,7 +3453,7 @@ export interface Version { * * {Promise} A promise is returned. * - * @resolve {VersionResource} - The deserialized result object. + * @resolve {ApplicationTypeVersionResourceList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2867,30 +3461,41 @@ export interface Version { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VersionResource} [result] - The deserialized result object if an error did not occur. - * See {@link VersionResource} for more information. + * {ApplicationTypeVersionResourceList} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationTypeVersionResourceList} 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(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, parameters: models.VersionResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - patch(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, parameters: models.VersionResource, callback: ServiceCallback): void; - patch(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, parameters: models.VersionResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, clusterName: string, applicationTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, clusterName: string, applicationTypeName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, clusterName: string, applicationTypeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Unprovisions an application type version resource. + * @summary Creates or updates a Service Fabric application type version + * resource. + * + * Create or update a Service Fabric application type version resource with the + * specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationTypeName The name of the application type name - * resource + * resource. * * @param {string} version The application type version. * + * @param {object} parameters The application type version resource. + * + * @param {string} parameters.appPackageUrl The URL to the application package + * + * @param {string} [parameters.location] Azure resource location. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2898,24 +3503,34 @@ export interface Version { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, parameters: models.ApplicationTypeVersionResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Unprovisions an application type version resource. + * @summary Creates or updates a Service Fabric application type version + * resource. + * + * Create or update a Service Fabric application type version resource with the + * specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationTypeName The name of the application type name - * resource + * resource. * * @param {string} version The application type version. * + * @param {object} parameters The application type version resource. + * + * @param {string} parameters.appPackageUrl The URL to the application package + * + * @param {string} [parameters.location] Azure resource location. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2928,7 +3543,7 @@ export interface Version { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ApplicationTypeVersionResource} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -2936,26 +3551,33 @@ export interface Version { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ApplicationTypeVersionResource} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationTypeVersionResource} 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. */ - deleteMethod(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, parameters: models.ApplicationTypeVersionResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreate(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, parameters: models.ApplicationTypeVersionResource, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, parameters: models.ApplicationTypeVersionResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns all versions for the specified application type. + * @summary Deletes a Service Fabric application type version resource. + * + * Delete a Service Fabric application type version resource with the specified + * name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationTypeName The name of the application type name - * resource + * resource. + * + * @param {string} version The application type version. * * @param {object} [options] Optional Parameters. * @@ -2964,21 +3586,26 @@ export interface Version { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns all versions for the specified application type. + * @summary Deletes a Service Fabric application type version resource. + * + * Delete a Service Fabric application type version resource with the specified + * name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationTypeName The name of the application type name - * resource + * resource. + * + * @param {string} version The application type version. * * @param {object} [options] Optional Parameters. * @@ -2992,7 +3619,7 @@ export interface Version { * * {Promise} A promise is returned. * - * @resolve {VersionResourceList} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3000,57 +3627,1206 @@ export interface Version { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {VersionResourceList} [result] - The deserialized result object if an error did not occur. - * See {@link VersionResourceList} for more information. + * {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. */ - list(resourceGroupName: string, clusterName: string, applicationTypeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, clusterName: string, applicationTypeName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, clusterName: string, applicationTypeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, clusterName: string, applicationTypeName: string, version: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** * @class - * Application + * Applications * __NOTE__: An instance of this class is automatically created for an * instance of the ServiceFabricManagementClient. */ -export interface Application { +export interface Applications { + + + /** + * @summary Gets a Service Fabric application resource. + * + * Get a Service Fabric application resource created or in the process of being + * created in the Service Fabric cluster resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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, clusterName: string, applicationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a Service Fabric application resource. + * + * Get a Service Fabric application resource created or in the process of being + * created in the Service Fabric cluster resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @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 {ApplicationResource} - 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. + * + * {ApplicationResource} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationResource} 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, clusterName: string, applicationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, clusterName: string, applicationName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, clusterName: string, applicationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns an application resource with the specified name. + * @summary Creates or updates a Service Fabric application resource. + * + * Create or update a Service Fabric application resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} parameters The application resource. + * + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. + * + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. + * + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). + * + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} + * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [parameters.minimumNodes] The minimum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. If this property is set to zero, no capacity will be reserved. + * The value of this property cannot be more than the value of the MaximumNodes + * property. + * + * @param {number} [parameters.maximumNodes] The maximum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. By default, the value of this property is zero and it means + * that the services can be placed on any node. + * + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. + * + * @param {array} [parameters.metrics] List of application capacity metric + * description. + * + * @param {string} [parameters.typeName] The application type name as defined + * in the application manifest. + * + * @param {string} [parameters.location] Azure resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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. + */ + createWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates a Service Fabric application resource. + * + * Create or update a Service Fabric application resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} parameters The application resource. + * + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. + * + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. + * + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). + * + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} + * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [parameters.minimumNodes] The minimum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. If this property is set to zero, no capacity will be reserved. + * The value of this property cannot be more than the value of the MaximumNodes + * property. + * + * @param {number} [parameters.maximumNodes] The maximum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. By default, the value of this property is zero and it means + * that the services can be placed on any node. + * + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. + * + * @param {array} [parameters.metrics] List of application capacity metric + * description. + * + * @param {string} [parameters.typeName] The application type name as defined + * in the application manifest. + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 {ApplicationResource} - 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. + * + * {ApplicationResource} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationResource} 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. + */ + create(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResource, callback: ServiceCallback): void; + create(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates a Service Fabric application resource. + * + * Update a Service Fabric application resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} parameters The application resource for patch operations. + * + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. + * + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. + * + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). + * + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} + * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [parameters.minimumNodes] The minimum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. If this property is set to zero, no capacity will be reserved. + * The value of this property cannot be more than the value of the MaximumNodes + * property. + * + * @param {number} [parameters.maximumNodes] The maximum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. By default, the value of this property is zero and it means + * that the services can be placed on any node. + * + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. + * + * @param {array} [parameters.metrics] List of application capacity metric + * description. + * + * @param {string} [parameters.location] Azure resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResourceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates a Service Fabric application resource. + * + * Update a Service Fabric application resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} parameters The application resource for patch operations. + * + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. + * + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. + * + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). + * + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} + * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [parameters.minimumNodes] The minimum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. If this property is set to zero, no capacity will be reserved. + * The value of this property cannot be more than the value of the MaximumNodes + * property. + * + * @param {number} [parameters.maximumNodes] The maximum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. By default, the value of this property is zero and it means + * that the services can be placed on any node. + * + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. + * + * @param {array} [parameters.metrics] List of application capacity metric + * description. + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 {ApplicationResourceUpdate} - 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. + * + * {ApplicationResourceUpdate} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationResourceUpdate} 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(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResourceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResourceUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResourceUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a Service Fabric application resource. + * + * Delete a Service Fabric application resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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, clusterName: string, applicationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a Service Fabric application resource. + * + * Delete a Service Fabric application resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @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, clusterName: string, applicationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, clusterName: string, applicationName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, clusterName: string, applicationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the list of application resources created in the specified + * Service Fabric cluster resource. + * + * Gets all application resources created or in the process of being created in + * the Service Fabric cluster resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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(resourceGroupName: string, clusterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the list of application resources created in the specified + * Service Fabric cluster resource. + * + * Gets all application resources created or in the process of being created in + * the Service Fabric cluster resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @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 {ApplicationResourceList} - 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. + * + * {ApplicationResourceList} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationResourceList} 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(resourceGroupName: string, clusterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, clusterName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, clusterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates or updates a Service Fabric application resource. + * + * Create or update a Service Fabric application resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} parameters The application resource. + * + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. + * + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. + * + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). + * + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} + * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {number} [parameters.minimumNodes] The minimum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. If this property is set to zero, no capacity will be reserved. + * The value of this property cannot be more than the value of the MaximumNodes + * property. + * + * @param {number} [parameters.maximumNodes] The maximum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. By default, the value of this property is zero and it means + * that the services can be placed on any node. + * + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. + * + * @param {array} [parameters.metrics] List of application capacity metric + * description. + * + * @param {string} [parameters.typeName] The application type name as defined + * in the application manifest. + * + * @param {string} [parameters.location] Azure resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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. + */ + beginCreateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates a Service Fabric application resource. + * + * Create or update a Service Fabric application resource with the specified + * name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} parameters The application resource. + * + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. + * + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. + * + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. + * + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). + * + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). + * + * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {string} + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. + * + * @param {boolean} + * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] + * Indicates whether warnings are treated with the same severity as errors. + * + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] + * The maximum allowed percentage of unhealthy deployed applications. Allowed + * values are Byte values from zero to 100. + * The percentage represents the maximum tolerated percentage of deployed + * applications that can be unhealthy before the application is considered in + * error. + * This is calculated by dividing the number of unhealthy deployed applications + * over the number of nodes where the application is currently deployed on in + * the cluster. + * The computation rounds up to tolerate one failure on small numbers of nodes. + * Default percentage is zero. * - * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. * - * @param {string} applicationName The name of the application resource. + * @param {number} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. * - * @param {object} [options] Optional Parameters. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * - * @returns {Promise} A promise is returned + * @param {number} [parameters.minimumNodes] The minimum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. If this property is set to zero, no capacity will be reserved. + * The value of this property cannot be more than the value of the MaximumNodes + * property. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {number} [parameters.maximumNodes] The maximum number of nodes where + * Service Fabric will reserve capacity for this application. Note that this + * does not mean that the services of this application will be placed on all of + * those nodes. By default, the value of this property is zero and it means + * that the services can be placed on any node. * - * @reject {Error|ServiceError} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns an application resource with the specified name. + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. * - * @param {string} resourceGroupName The name of the resource group. + * @param {array} [parameters.metrics] List of application capacity metric + * description. * - * @param {string} clusterName The name of the cluster resource + * @param {string} [parameters.typeName] The application type name as defined + * in the application manifest. * - * @param {string} applicationName The name of the application resource. + * @param {string} [parameters.location] Azure resource location. * * @param {object} [options] Optional Parameters. * @@ -3079,50 +4855,99 @@ export interface Application { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName: string, clusterName: string, applicationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, clusterName: string, applicationName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, clusterName: string, applicationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreate(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResource, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates an application resource with the specified name. + * @summary Updates a Service Fabric application resource. + * + * Update a Service Fabric application resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationName The name of the application resource. * - * @param {object} parameters The application resource. + * @param {object} parameters The application resource for patch operations. * - * @param {string} [parameters.typeVersion] + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. * - * @param {array} [parameters.parameters] + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. * - * @param {object} [parameters.upgradePolicy] + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. * - * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). * - * @param {boolean} [parameters.upgradePolicy.forceRestart] + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). * * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade * * @param {string} * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. * * @param {string} * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. * * @param {string} * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. * * @param {string} - * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. * * @param {string} * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * - * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {boolean} * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] @@ -3143,56 +4968,19 @@ export interface Application { * * * @param {object} - * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * - * @param {number} - * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. Allowed - * values are Byte values from zero to 100 - * - * The percentage represents the maximum tolerated percentage of partitions - * that can be unhealthy before the service is considered in error. - * If the percentage is respected but there is at least one unhealthy - * partition, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy partitions - * over the total number of partitions in the service. - * The computation rounds up to tolerate one failure on small numbers of - * partitions. Default percentage is zero. - * - * - * @param {number} - * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. Allowed - * values are Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of replicas that - * can be unhealthy before the partition is considered in error. - * If the percentage is respected but there is at least one unhealthy replica, - * the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy replicas - * over the total number of replicas in the partition. - * The computation rounds up to tolerate one failure on small numbers of - * replicas. Default percentage is zero. - * + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. * * @param {number} - * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed values - * are Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of services that - * can be unhealthy before the application is considered in error. - * If the percentage is respected but there is at least one unhealthy service, - * the health is evaluated as Warning. - * This is calculated by dividing the number of unhealthy services of the - * specific service type over the total number of services of the specific - * service type. - * The computation rounds up to tolerate one failure on small numbers of - * services. Default percentage is zero. + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. * * - * @param {array} + * @param {object} * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {number} [parameters.minimumNodes] The minimum number of nodes where * Service Fabric will reserve capacity for this application. Note that this @@ -3207,14 +4995,13 @@ export interface Application { * those nodes. By default, the value of this property is zero and it means * that the services can be placed on any node. * - * @param {boolean} [parameters.removeApplicationCapacity] The version of the - * application type + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. * - * @param {array} [parameters.metrics] + * @param {array} [parameters.metrics] List of application capacity metric + * description. * - * @param {string} [parameters.typeName] - * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.location] Azure resource location. * * @param {object} [options] Optional Parameters. * @@ -3223,51 +5010,100 @@ export interface Application { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - putWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResourceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates an application resource with the specified name. + * @summary Updates a Service Fabric application resource. + * + * Update a Service Fabric application resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationName The name of the application resource. * - * @param {object} parameters The application resource. + * @param {object} parameters The application resource for patch operations. * - * @param {string} [parameters.typeVersion] + * @param {string} [parameters.typeVersion] The version of the application type + * as defined in the application manifest. * - * @param {array} [parameters.parameters] + * @param {object} [parameters.parameters] List of application parameters with + * overridden values from their default values specified in the application + * manifest. * - * @param {object} [parameters.upgradePolicy] + * @param {object} [parameters.upgradePolicy] Describes the policy for a + * monitored application upgrade. * - * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] + * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] The + * maximum amount of time to block processing of an upgrade domain and prevent + * loss of availability when there are unexpected issues. When this timeout + * expires, processing of the upgrade domain will proceed regardless of + * availability loss issues. The timeout is reset at the start of each upgrade + * domain. Valid values are between 0 and 42949672925 inclusive. (unsigned + * 32-bit integer). * - * @param {boolean} [parameters.upgradePolicy.forceRestart] + * @param {boolean} [parameters.upgradePolicy.forceRestart] If true, then + * processes are forcefully restarted during upgrade even when the code version + * has not changed (the upgrade only changes configuration or data). * * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * The policy used for monitoring the application upgrade * * @param {string} * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * The amount of time to wait after completing an upgrade domain before + * applying health policies. It is first interpreted as a string representing + * an ISO 8601 duration. If that fails, then it is interpreted as a number + * representing the total number of milliseconds. * * @param {string} * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * The amount of time that the application or cluster must remain healthy + * before the upgrade proceeds to the next upgrade domain. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. * * @param {string} * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * The amount of time to retry health evaluation when the application or + * cluster is unhealthy before FailureAction is executed. It is first + * interpreted as a string representing an ISO 8601 duration. If that fails, + * then it is interpreted as a number representing the total number of + * milliseconds. * * @param {string} - * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] + * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] The + * amount of time the overall upgrade has to complete before FailureAction is + * executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. * * @param {string} * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * The amount of time each upgrade domain has to complete before FailureAction + * is executed. It is first interpreted as a string representing an ISO 8601 + * duration. If that fails, then it is interpreted as a number representing the + * total number of milliseconds. + * + * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] Defines a + * health policy used to evaluate the health of an application or one of its + * children entities. + * + * + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * The health policy used by default to evaluate the health of a service type. * - * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] + * @param {object} + * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicies] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {boolean} * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] @@ -3288,56 +5124,19 @@ export interface Application { * * * @param {object} - * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] - * - * @param {number} - * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. Allowed - * values are Byte values from zero to 100 - * - * The percentage represents the maximum tolerated percentage of partitions - * that can be unhealthy before the service is considered in error. - * If the percentage is respected but there is at least one unhealthy - * partition, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy partitions - * over the total number of partitions in the service. - * The computation rounds up to tolerate one failure on small numbers of - * partitions. Default percentage is zero. - * - * - * @param {number} - * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. Allowed - * values are Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of replicas that - * can be unhealthy before the partition is considered in error. - * If the percentage is respected but there is at least one unhealthy replica, - * the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy replicas - * over the total number of replicas in the partition. - * The computation rounds up to tolerate one failure on small numbers of - * replicas. Default percentage is zero. - * + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1] + * The health policy used by default to evaluate the health of a service type. * * @param {number} - * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed values - * are Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of services that - * can be unhealthy before the application is considered in error. - * If the percentage is respected but there is at least one unhealthy service, - * the health is evaluated as Warning. - * This is calculated by dividing the number of unhealthy services of the - * specific service type over the total number of services of the specific - * service type. - * The computation rounds up to tolerate one failure on small numbers of - * services. Default percentage is zero. + * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy1.maxPercentUnhealthyServices] + * The maximum percentage of services allowed to be unhealthy before your + * application is considered in error. * * - * @param {array} + * @param {object} * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * The map with service type health policy per service type name. The map is + * empty by default. * * @param {number} [parameters.minimumNodes] The minimum number of nodes where * Service Fabric will reserve capacity for this application. Note that this @@ -3352,14 +5151,13 @@ export interface Application { * those nodes. By default, the value of this property is zero and it means * that the services can be placed on any node. * - * @param {boolean} [parameters.removeApplicationCapacity] The version of the - * application type + * @param {boolean} [parameters.removeApplicationCapacity] Remove the current + * application capacity settings. * - * @param {array} [parameters.metrics] + * @param {array} [parameters.metrics] List of application capacity metric + * description. * - * @param {string} [parameters.typeName] - * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.location] Azure resource location. * * @param {object} [options] Optional Parameters. * @@ -3373,7 +5171,7 @@ export interface Application { * * {Promise} A promise is returned. * - * @resolve {ApplicationResource} - The deserialized result object. + * @resolve {ApplicationResourceUpdate} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3381,290 +5179,273 @@ export interface Application { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ApplicationResource} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationResource} for more information. + * {ApplicationResourceUpdate} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationResourceUpdate} 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. */ - put(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - put(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResource, callback: ServiceCallback): void; - put(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResourceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResourceUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResourceUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates an application resource with the specified name. + * @summary Deletes a Service Fabric application resource. + * + * Delete a Service Fabric application resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationName The name of the application resource. * - * @param {object} parameters The application resource for patch operations. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.typeVersion] + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [parameters.parameters] + * @returns {Promise} A promise is returned * - * @param {object} [parameters.upgradePolicy] + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] + * @reject {Error|ServiceError} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a Service Fabric application resource. * - * @param {boolean} [parameters.upgradePolicy.forceRestart] + * Delete a Service Fabric application resource with the specified name. * - * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} - * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * @param {string} clusterName The name of the cluster resource. * - * @param {string} - * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * @param {string} applicationName The name of the application resource. * - * @param {string} - * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * @param {object} [options] Optional Parameters. * - * @param {string} - * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} - * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @param {boolean} - * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. + * {Promise} A promise is returned. * - * @param {number} - * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] - * The maximum allowed percentage of unhealthy deployed applications. Allowed - * values are Byte values from zero to 100. - * The percentage represents the maximum tolerated percentage of deployed - * applications that can be unhealthy before the application is considered in - * error. - * This is calculated by dividing the number of unhealthy deployed applications - * over the number of nodes where the application is currently deployed on in - * the cluster. - * The computation rounds up to tolerate one failure on small numbers of nodes. - * Default percentage is zero. + * @resolve {null} - The deserialized result object. * + * @reject {Error|ServiceError} - The error object. * - * @param {object} - * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * {ServiceCallback} optionalCallback(err, result, request, response) * - * @param {number} - * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. Allowed - * values are Byte values from zero to 100 + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * The percentage represents the maximum tolerated percentage of partitions - * that can be unhealthy before the service is considered in error. - * If the percentage is respected but there is at least one unhealthy - * partition, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy partitions - * over the total number of partitions in the service. - * The computation rounds up to tolerate one failure on small numbers of - * partitions. Default percentage is zero. + * {null} [result] - The deserialized result object if an error did not occur. * + * {WebResource} [request] - The HTTP Request object if an error did not occur. * - * @param {number} - * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. Allowed - * values are Byte values from zero to 100. + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName: string, clusterName: string, applicationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, clusterName: string, applicationName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, clusterName: string, applicationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Services + * __NOTE__: An instance of this class is automatically created for an + * instance of the ServiceFabricManagementClient. + */ +export interface Services { + + + /** + * @summary Gets a Service Fabric service resource. * - * The percentage represents the maximum tolerated percentage of replicas that - * can be unhealthy before the partition is considered in error. - * If the percentage is respected but there is at least one unhealthy replica, - * the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy replicas - * over the total number of replicas in the partition. - * The computation rounds up to tolerate one failure on small numbers of - * replicas. Default percentage is zero. + * Get a Service Fabric service resource created or in the process of being + * created in the Service Fabric application resource. * + * @param {string} resourceGroupName The name of the resource group. * - * @param {number} - * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed values - * are Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of services that - * can be unhealthy before the application is considered in error. - * If the percentage is respected but there is at least one unhealthy service, - * the health is evaluated as Warning. - * This is calculated by dividing the number of unhealthy services of the - * specific service type over the total number of services of the specific - * service type. - * The computation rounds up to tolerate one failure on small numbers of - * services. Default percentage is zero. + * @param {string} clusterName The name of the cluster resource. * + * @param {string} applicationName The name of the application resource. * - * @param {array} - * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. * - * @param {number} [parameters.minimumNodes] The minimum number of nodes where - * Service Fabric will reserve capacity for this application. Note that this - * does not mean that the services of this application will be placed on all of - * those nodes. If this property is set to zero, no capacity will be reserved. - * The value of this property cannot be more than the value of the MaximumNodes - * property. + * @param {object} [options] Optional Parameters. * - * @param {number} [parameters.maximumNodes] The maximum number of nodes where - * Service Fabric will reserve capacity for this application. Note that this - * does not mean that the services of this application will be placed on all of - * those nodes. By default, the value of this property is zero and it means - * that the services can be placed on any node. + * @param {object} [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, clusterName: string, applicationName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a Service Fabric service resource. * - * @param {boolean} [parameters.removeApplicationCapacity] The version of the - * application type + * Get a Service Fabric service resource created or in the process of being + * created in the Service Fabric application resource. * - * @param {array} [parameters.metrics] + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. * - * @param {string} parameters.location Resource location. + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request * - * @returns {Promise} A promise is returned + * @param {ServiceCallback} [optionalCallback] - The optional callback. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. * - * @reject {Error|ServiceError} - The error object. + * {Promise} A promise is returned. + * + * @resolve {ServiceResource} - 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. + * + * {ServiceResource} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceResource} 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. */ - patchWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResourceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + get(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** - * Updates an application resource with the specified name. + * @summary Creates or updates a Service Fabric service resource. + * + * Create or update a Service Fabric service resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationName The name of the application resource. * - * @param {object} parameters The application resource for patch operations. + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @param {object} parameters The service resource. + * + * @param {string} [parameters.placementConstraints] The placement constraints + * as a string. Placement constraints are boolean expressions on node + * properties and allow for restricting a service to particular nodes based on + * the service requirements. For example, to place a service on nodes where + * NodeType is blue specify the following: "NodeColor == blue)". * - * @param {string} [parameters.typeVersion] + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. * - * @param {array} [parameters.parameters] + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. * - * @param {object} [parameters.upgradePolicy] + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. * - * @param {number} [parameters.upgradePolicy.upgradeReplicaSetCheckTimeout] + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' * - * @param {boolean} [parameters.upgradePolicy.forceRestart] + * @param {string} [parameters.serviceTypeName] The name of the service type * - * @param {object} [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy] + * @param {object} [parameters.partitionDescription] Describes how the service + * is partitioned. * - * @param {string} - * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckWaitDuration] + * @param {string} parameters.partitionDescription.partitionScheme Polymorphic + * Discriminator * - * @param {string} - * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckStableDuration] + * @param {string} parameters.serviceKind Polymorphic Discriminator * - * @param {string} - * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.healthCheckRetryTimeout] + * @param {string} [parameters.location] Azure resource location. * - * @param {string} - * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeTimeout] + * @param {object} [options] Optional Parameters. * - * @param {string} - * [parameters.upgradePolicy.rollingUpgradeMonitoringPolicy.upgradeDomainTimeout] + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.upgradePolicy.applicationHealthPolicy] + * @returns {Promise} A promise is returned * - * @param {boolean} - * [parameters.upgradePolicy.applicationHealthPolicy.considerWarningAsError] - * Indicates whether warnings are treated with the same severity as errors. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {number} - * [parameters.upgradePolicy.applicationHealthPolicy.maxPercentUnhealthyDeployedApplications] - * The maximum allowed percentage of unhealthy deployed applications. Allowed - * values are Byte values from zero to 100. - * The percentage represents the maximum tolerated percentage of deployed - * applications that can be unhealthy before the application is considered in - * error. - * This is calculated by dividing the number of unhealthy deployed applications - * over the number of nodes where the application is currently deployed on in - * the cluster. - * The computation rounds up to tolerate one failure on small numbers of nodes. - * Default percentage is zero. + * @reject {Error|ServiceError} - The error object. + */ + createWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates a Service Fabric service resource. * + * Create or update a Service Fabric service resource with the specified name. * - * @param {object} - * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy] + * @param {string} resourceGroupName The name of the resource group. * - * @param {number} - * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyPartitionsPerService] - * The maximum allowed percentage of unhealthy partitions per service. Allowed - * values are Byte values from zero to 100 + * @param {string} clusterName The name of the cluster resource. * - * The percentage represents the maximum tolerated percentage of partitions - * that can be unhealthy before the service is considered in error. - * If the percentage is respected but there is at least one unhealthy - * partition, the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy partitions - * over the total number of partitions in the service. - * The computation rounds up to tolerate one failure on small numbers of - * partitions. Default percentage is zero. + * @param {string} applicationName The name of the application resource. * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. * - * @param {number} - * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyReplicasPerPartition] - * The maximum allowed percentage of unhealthy replicas per partition. Allowed - * values are Byte values from zero to 100. + * @param {object} parameters The service resource. * - * The percentage represents the maximum tolerated percentage of replicas that - * can be unhealthy before the partition is considered in error. - * If the percentage is respected but there is at least one unhealthy replica, - * the health is evaluated as Warning. - * The percentage is calculated by dividing the number of unhealthy replicas - * over the total number of replicas in the partition. - * The computation rounds up to tolerate one failure on small numbers of - * replicas. Default percentage is zero. + * @param {string} [parameters.placementConstraints] The placement constraints + * as a string. Placement constraints are boolean expressions on node + * properties and allow for restricting a service to particular nodes based on + * the service requirements. For example, to place a service on nodes where + * NodeType is blue specify the following: "NodeColor == blue)". * + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. * - * @param {number} - * [parameters.upgradePolicy.applicationHealthPolicy.defaultServiceTypeHealthPolicy.maxPercentUnhealthyServices] - * The maximum maximum allowed percentage of unhealthy services. Allowed values - * are Byte values from zero to 100. - * - * The percentage represents the maximum tolerated percentage of services that - * can be unhealthy before the application is considered in error. - * If the percentage is respected but there is at least one unhealthy service, - * the health is evaluated as Warning. - * This is calculated by dividing the number of unhealthy services of the - * specific service type over the total number of services of the specific - * service type. - * The computation rounds up to tolerate one failure on small numbers of - * services. Default percentage is zero. + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. * + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. * - * @param {array} - * [parameters.upgradePolicy.applicationHealthPolicy.serviceTypeHealthPolicyMap] + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' * - * @param {number} [parameters.minimumNodes] The minimum number of nodes where - * Service Fabric will reserve capacity for this application. Note that this - * does not mean that the services of this application will be placed on all of - * those nodes. If this property is set to zero, no capacity will be reserved. - * The value of this property cannot be more than the value of the MaximumNodes - * property. + * @param {string} [parameters.serviceTypeName] The name of the service type * - * @param {number} [parameters.maximumNodes] The maximum number of nodes where - * Service Fabric will reserve capacity for this application. Note that this - * does not mean that the services of this application will be placed on all of - * those nodes. By default, the value of this property is zero and it means - * that the services can be placed on any node. + * @param {object} [parameters.partitionDescription] Describes how the service + * is partitioned. * - * @param {boolean} [parameters.removeApplicationCapacity] The version of the - * application type + * @param {string} parameters.partitionDescription.partitionScheme Polymorphic + * Discriminator * - * @param {array} [parameters.metrics] + * @param {string} parameters.serviceKind Polymorphic Discriminator * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.location] Azure resource location. * * @param {object} [options] Optional Parameters. * @@ -3678,7 +5459,7 @@ export interface Application { * * {Promise} A promise is returned. * - * @resolve {ApplicationResourceUpdate} - The deserialized result object. + * @resolve {ServiceResource} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3686,28 +5467,56 @@ export interface Application { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ApplicationResourceUpdate} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationResourceUpdate} for more - * information. + * {ServiceResource} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceResource} 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(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResourceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - patch(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResourceUpdate, callback: ServiceCallback): void; - patch(resourceGroupName: string, clusterName: string, applicationName: string, parameters: models.ApplicationResourceUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + create(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + create(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResource, callback: ServiceCallback): void; + create(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes an application resource with the specified name. + * @summary Updates a Service Fabric service resource. + * + * Update a Service Fabric service resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationName The name of the application resource. * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @param {object} parameters The service resource for patch operations. + * + * @param {string} [parameters.placementConstraints] The placement constraints + * as a string. Placement constraints are boolean expressions on node + * properties and allow for restricting a service to particular nodes based on + * the service requirements. For example, to place a service on nodes where + * NodeType is blue specify the following: "NodeColor == blue)". + * + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. + * + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. + * + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. + * + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * + * @param {string} parameters.serviceKind Polymorphic Discriminator + * + * @param {string} [parameters.location] Azure resource location. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3715,21 +5524,50 @@ export interface Application { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResourceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes an application resource with the specified name. + * @summary Updates a Service Fabric service resource. + * + * Update a Service Fabric service resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationName The name of the application resource. * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @param {object} parameters The service resource for patch operations. + * + * @param {string} [parameters.placementConstraints] The placement constraints + * as a string. Placement constraints are boolean expressions on node + * properties and allow for restricting a service to particular nodes based on + * the service requirements. For example, to place a service on nodes where + * NodeType is blue specify the following: "NodeColor == blue)". + * + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. + * + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. + * + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. + * + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * + * @param {string} parameters.serviceKind Polymorphic Discriminator + * + * @param {string} [parameters.location] Azure resource location. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3742,7 +5580,7 @@ export interface Application { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {ServiceResourceUpdate} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3750,23 +5588,31 @@ export interface Application { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {ServiceResourceUpdate} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceResourceUpdate} 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. */ - deleteMethod(resourceGroupName: string, clusterName: string, applicationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, clusterName: string, applicationName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, clusterName: string, applicationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResourceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResourceUpdate, callback: ServiceCallback): void; + update(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResourceUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns all application resources in the specified cluster. + * @summary Deletes a Service Fabric service resource. + * + * Delete a Service Fabric service resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. * * @param {object} [options] Optional Parameters. * @@ -3775,18 +5621,25 @@ export interface Application { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listWithHttpOperationResponse(resourceGroupName: string, clusterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns all application resources in the specified cluster. + * @summary Deletes a Service Fabric service resource. + * + * Delete a Service Fabric service resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. * * @param {object} [options] Optional Parameters. * @@ -3800,7 +5653,7 @@ export interface Application { * * {Promise} A promise is returned. * - * @resolve {ApplicationResourceList} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3808,40 +5661,30 @@ export interface Application { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ApplicationResourceList} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationResourceList} for more - * information. + * {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. */ - list(resourceGroupName: string, clusterName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, clusterName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, clusterName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Service - * __NOTE__: An instance of this class is automatically created for an - * instance of the ServiceFabricManagementClient. - */ -export interface Service { + deleteMethod(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Returns a service resource with the specified name. + * @summary Gets the list of service resources created in the specified Service + * Fabric application resource. + * + * Gets all service resources created or in the process of being created in the + * Service Fabric application resource. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationName The name of the application resource. * - * @param {string} serviceName The name of the service resource in the format - * of {applicationName}~{serviceName}. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3849,24 +5692,25 @@ export interface Service { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Returns a service resource with the specified name. + * @summary Gets the list of service resources created in the specified Service + * Fabric application resource. + * + * Gets all service resources created or in the process of being created in the + * Service Fabric application resource. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationName The name of the application resource. * - * @param {string} serviceName The name of the service resource in the format - * of {applicationName}~{serviceName}. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3879,7 +5723,7 @@ export interface Service { * * {Promise} A promise is returned. * - * @resolve {ServiceResource} - The deserialized result object. + * @resolve {ServiceResourceList} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -3887,24 +5731,26 @@ export interface Service { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {ServiceResource} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceResource} for more information. + * {ServiceResourceList} [result] - The deserialized result object if an error did not occur. + * See {@link ServiceResourceList} 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, clusterName: string, applicationName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - get(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, callback: ServiceCallback): void; - get(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + list(resourceGroupName: string, clusterName: string, applicationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(resourceGroupName: string, clusterName: string, applicationName: string, callback: ServiceCallback): void; + list(resourceGroupName: string, clusterName: string, applicationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Creates or updates a service resource with the specified name. + * @summary Creates or updates a Service Fabric service resource. + * + * Create or update a Service Fabric service resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationName The name of the application resource. * @@ -3919,28 +5765,29 @@ export interface Service { * the service requirements. For example, to place a service on nodes where * NodeType is blue specify the following: "NodeColor == blue)". * - * @param {array} [parameters.correlationScheme] + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. * - * @param {array} [parameters.serviceLoadMetrics] + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. * - * @param {array} [parameters.servicePlacementPolicies] + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. * - * @param {string} [parameters.defaultMoveCost] Possible values include: - * 'Zero', 'Low', 'Medium', 'High' - * - * @param {string} [parameters.serviceKind] Possible values include: 'Invalid', - * 'Stateless', 'Stateful' + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' * * @param {string} [parameters.serviceTypeName] The name of the service type * - * @param {object} [parameters.partitionDescription] + * @param {object} [parameters.partitionDescription] Describes how the service + * is partitioned. * * @param {string} parameters.partitionDescription.partitionScheme Polymorphic * Discriminator * - * @param {string} parameters.serviceResourceType Polymorphic Discriminator + * @param {string} parameters.serviceKind Polymorphic Discriminator * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.location] Azure resource location. * * @param {object} [options] Optional Parameters. * @@ -3953,14 +5800,16 @@ export interface Service { * * @reject {Error|ServiceError} - The error object. */ - putWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Creates or updates a service resource with the specified name. + * @summary Creates or updates a Service Fabric service resource. + * + * Create or update a Service Fabric service resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationName The name of the application resource. * @@ -3975,28 +5824,29 @@ export interface Service { * the service requirements. For example, to place a service on nodes where * NodeType is blue specify the following: "NodeColor == blue)". * - * @param {array} [parameters.correlationScheme] + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. * - * @param {array} [parameters.serviceLoadMetrics] + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. * - * @param {array} [parameters.servicePlacementPolicies] + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. * - * @param {string} [parameters.defaultMoveCost] Possible values include: - * 'Zero', 'Low', 'Medium', 'High' - * - * @param {string} [parameters.serviceKind] Possible values include: 'Invalid', - * 'Stateless', 'Stateful' + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' * * @param {string} [parameters.serviceTypeName] The name of the service type * - * @param {object} [parameters.partitionDescription] + * @param {object} [parameters.partitionDescription] Describes how the service + * is partitioned. * * @param {string} parameters.partitionDescription.partitionScheme Polymorphic * Discriminator * - * @param {string} parameters.serviceResourceType Polymorphic Discriminator + * @param {string} parameters.serviceKind Polymorphic Discriminator * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.location] Azure resource location. * * @param {object} [options] Optional Parameters. * @@ -4025,17 +5875,19 @@ export interface Service { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - put(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - put(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResource, callback: ServiceCallback): void; - put(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreate(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResource, callback: ServiceCallback): void; + beginCreate(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Updates a service resource with the specified name. + * @summary Updates a Service Fabric service resource. + * + * Update a Service Fabric service resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationName The name of the application resource. * @@ -4050,18 +5902,21 @@ export interface Service { * the service requirements. For example, to place a service on nodes where * NodeType is blue specify the following: "NodeColor == blue)". * - * @param {array} [parameters.correlationScheme] + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. * - * @param {array} [parameters.serviceLoadMetrics] + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. * - * @param {array} [parameters.servicePlacementPolicies] + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. * - * @param {string} [parameters.defaultMoveCost] Possible values include: - * 'Zero', 'Low', 'Medium', 'High' + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' * - * @param {string} parameters.serviceResourceType Polymorphic Discriminator + * @param {string} parameters.serviceKind Polymorphic Discriminator * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.location] Azure resource location. * * @param {object} [options] Optional Parameters. * @@ -4074,14 +5929,16 @@ export interface Service { * * @reject {Error|ServiceError} - The error object. */ - patchWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResourceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginUpdateWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResourceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Updates a service resource with the specified name. + * @summary Updates a Service Fabric service resource. + * + * Update a Service Fabric service resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationName The name of the application resource. * @@ -4096,18 +5953,21 @@ export interface Service { * the service requirements. For example, to place a service on nodes where * NodeType is blue specify the following: "NodeColor == blue)". * - * @param {array} [parameters.correlationScheme] + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. * - * @param {array} [parameters.serviceLoadMetrics] + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. * - * @param {array} [parameters.servicePlacementPolicies] + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. * - * @param {string} [parameters.defaultMoveCost] Possible values include: - * 'Zero', 'Low', 'Medium', 'High' + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' * - * @param {string} parameters.serviceResourceType Polymorphic Discriminator + * @param {string} parameters.serviceKind Polymorphic Discriminator * - * @param {string} parameters.location Resource location. + * @param {string} [parameters.location] Azure resource location. * * @param {object} [options] Optional Parameters. * @@ -4136,17 +5996,19 @@ export interface Service { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - patch(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResourceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - patch(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResourceUpdate, callback: ServiceCallback): void; - patch(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResourceUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResourceUpdate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginUpdate(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResourceUpdate, callback: ServiceCallback): void; + beginUpdate(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, parameters: models.ServiceResourceUpdate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** - * Deletes a service resource with the specified name. + * @summary Deletes a Service Fabric service resource. + * + * Delete a Service Fabric service resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationName The name of the application resource. * @@ -4164,14 +6026,16 @@ export interface Service { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * Deletes a service resource with the specified name. + * @summary Deletes a Service Fabric service resource. + * + * Delete a Service Fabric service resource with the specified name. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} clusterName The name of the cluster resource + * @param {string} clusterName The name of the cluster resource. * * @param {string} applicationName The name of the application resource. * @@ -4204,70 +6068,7 @@ export interface Service { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * Returns all service resources in the specified application. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} clusterName The name of the cluster resource - * - * @param {string} applicationName The name of the application resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [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(resourceGroupName: string, clusterName: string, applicationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * Returns all service resources in the specified application. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} clusterName The name of the cluster resource - * - * @param {string} applicationName The name of the application resource. - * - * @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 {ServiceResourceList} - 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. - * - * {ServiceResourceList} [result] - The deserialized result object if an error did not occur. - * See {@link ServiceResourceList} 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(resourceGroupName: string, clusterName: string, applicationName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - list(resourceGroupName: string, clusterName: string, applicationName: string, callback: ServiceCallback): void; - list(resourceGroupName: string, clusterName: string, applicationName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, clusterName: string, applicationName: string, serviceName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } diff --git a/lib/services/serviceFabricManagement/lib/operations/index.js b/lib/services/serviceFabricManagement/lib/operations/index.js index f3963b06ad..e4710077c7 100644 --- a/lib/services/serviceFabricManagement/lib/operations/index.js +++ b/lib/services/serviceFabricManagement/lib/operations/index.js @@ -17,7 +17,7 @@ exports.Clusters = require('./clusters'); exports.ClusterVersions = require('./clusterVersions'); exports.Operations = require('./operations'); -exports.ApplicationType = require('./applicationType'); -exports.Version = require('./version'); -exports.Application = require('./application'); -exports.Service = require('./service'); +exports.ApplicationTypes = require('./applicationTypes'); +exports.ApplicationTypeVersions = require('./applicationTypeVersions'); +exports.Applications = require('./applications'); +exports.Services = require('./services'); diff --git a/lib/services/serviceFabricManagement/lib/operations/operations.js b/lib/services/serviceFabricManagement/lib/operations/operations.js index 3e70db45ec..9b592c7b4e 100644 --- a/lib/services/serviceFabricManagement/lib/operations/operations.js +++ b/lib/services/serviceFabricManagement/lib/operations/operations.js @@ -15,11 +15,13 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * @summary Lists all of the available ServiceFabric Resource Manager REST API + * @summary Lists all of the available Service Fabric resource provider API * operations. * - * @param {string} apiVersion The version of the ServiceFabric resouce provider - * api + * Get the list of available Service Fabric resource provider API operations. + * + * @param {string} apiVersion The version of the Service Fabric resouce + * provider API * * @param {object} [options] Optional Parameters. * @@ -149,9 +151,11 @@ function _list(apiVersion, options, callback) { } /** - * @summary Lists all of the available ServiceFabric Resource Manager REST API + * @summary Lists all of the available Service Fabric resource provider API * operations. * + * Get the list of available Service Fabric resource provider API operations. + * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * @@ -290,11 +294,13 @@ class Operations { } /** - * @summary Lists all of the available ServiceFabric Resource Manager REST API + * @summary Lists all of the available Service Fabric resource provider API * operations. * - * @param {string} apiVersion The version of the ServiceFabric resouce provider - * api + * Get the list of available Service Fabric resource provider API operations. + * + * @param {string} apiVersion The version of the Service Fabric resouce + * provider API * * @param {object} [options] Optional Parameters. * @@ -322,11 +328,13 @@ class Operations { } /** - * @summary Lists all of the available ServiceFabric Resource Manager REST API + * @summary Lists all of the available Service Fabric resource provider API * operations. * - * @param {string} apiVersion The version of the ServiceFabric resouce provider - * api + * Get the list of available Service Fabric resource provider API operations. + * + * @param {string} apiVersion The version of the Service Fabric resouce + * provider API * * @param {object} [options] Optional Parameters. * @@ -376,9 +384,11 @@ class Operations { } /** - * @summary Lists all of the available ServiceFabric Resource Manager REST API + * @summary Lists all of the available Service Fabric resource provider API * operations. * + * Get the list of available Service Fabric resource provider API operations. + * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * @@ -408,9 +418,11 @@ class Operations { } /** - * @summary Lists all of the available ServiceFabric Resource Manager REST API + * @summary Lists all of the available Service Fabric resource provider API * operations. * + * Get the list of available Service Fabric resource provider API operations. + * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. * diff --git a/lib/services/serviceFabricManagement/lib/operations/services.js b/lib/services/serviceFabricManagement/lib/operations/services.js new file mode 100644 index 0000000000..dfb2503dde --- /dev/null +++ b/lib/services/serviceFabricManagement/lib/operations/services.js @@ -0,0 +1,2218 @@ +/* + * 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; + +/** + * @summary Gets a Service Fabric service resource. + * + * Get a Service Fabric service resource created or in the process of being + * created in the Service Fabric application resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @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 ServiceResource} 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, clusterName, applicationName, serviceName, 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 apiVersion = '2017-07-01-preview'; + // 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 (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (applicationName === null || applicationName === undefined || typeof applicationName.valueOf() !== 'string') { + throw new Error('applicationName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName 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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{applicationName}', encodeURIComponent(applicationName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ServiceResource']().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); + }); +} + + +/** + * @summary Creates or updates a Service Fabric service resource. + * + * Create or update a Service Fabric service resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @param {object} parameters The service resource. + * + * @param {string} [parameters.placementConstraints] The placement constraints + * as a string. Placement constraints are boolean expressions on node + * properties and allow for restricting a service to particular nodes based on + * the service requirements. For example, to place a service on nodes where + * NodeType is blue specify the following: "NodeColor == blue)". + * + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. + * + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. + * + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. + * + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * + * @param {string} [parameters.serviceTypeName] The name of the service type + * + * @param {object} [parameters.partitionDescription] Describes how the service + * is partitioned. + * + * @param {string} parameters.partitionDescription.partitionScheme Polymorphic + * Discriminator + * + * @param {string} parameters.serviceKind Polymorphic Discriminator + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 ServiceResource} 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 _create(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreate(resourceGroupName, clusterName, applicationName, serviceName, parameters, 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['ServiceResource']().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); + }); + }); +} + + +/** + * @summary Updates a Service Fabric service resource. + * + * Update a Service Fabric service resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @param {object} parameters The service resource for patch operations. + * + * @param {string} [parameters.placementConstraints] The placement constraints + * as a string. Placement constraints are boolean expressions on node + * properties and allow for restricting a service to particular nodes based on + * the service requirements. For example, to place a service on nodes where + * NodeType is blue specify the following: "NodeColor == blue)". + * + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. + * + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. + * + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. + * + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * + * @param {string} parameters.serviceKind Polymorphic Discriminator + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 ServiceResourceUpdate} 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(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginUpdate(resourceGroupName, clusterName, applicationName, serviceName, parameters, 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['ServiceResourceUpdate']().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); + }); + }); +} + + +/** + * @summary Deletes a Service Fabric service resource. + * + * Delete a Service Fabric service resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @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, clusterName, applicationName, serviceName, 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(resourceGroupName, clusterName, applicationName, serviceName, 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); + }); + }); +} + +/** + * @summary Gets the list of service resources created in the specified Service + * Fabric application resource. + * + * Gets all service resources created or in the process of being created in the + * Service Fabric application resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @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 ServiceResourceList} 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(resourceGroupName, clusterName, applicationName, 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 apiVersion = '2017-07-01-preview'; + // 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 (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (applicationName === null || applicationName === undefined || typeof applicationName.valueOf() !== 'string') { + throw new Error('applicationName 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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{applicationName}', encodeURIComponent(applicationName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ServiceResourceList']().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); + }); +} + +/** + * @summary Creates or updates a Service Fabric service resource. + * + * Create or update a Service Fabric service resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @param {object} parameters The service resource. + * + * @param {string} [parameters.placementConstraints] The placement constraints + * as a string. Placement constraints are boolean expressions on node + * properties and allow for restricting a service to particular nodes based on + * the service requirements. For example, to place a service on nodes where + * NodeType is blue specify the following: "NodeColor == blue)". + * + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. + * + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. + * + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. + * + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * + * @param {string} [parameters.serviceTypeName] The name of the service type + * + * @param {object} [parameters.partitionDescription] Describes how the service + * is partitioned. + * + * @param {string} parameters.partitionDescription.partitionScheme Polymorphic + * Discriminator + * + * @param {string} parameters.serviceKind Polymorphic Discriminator + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 ServiceResource} 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 _beginCreate(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-07-01-preview'; + // 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 (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (applicationName === null || applicationName === undefined || typeof applicationName.valueOf() !== 'string') { + throw new Error('applicationName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{applicationName}', encodeURIComponent(applicationName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['ServiceResource']().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 !== 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 === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceResource']().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); + }); +} + +/** + * @summary Updates a Service Fabric service resource. + * + * Update a Service Fabric service resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @param {object} parameters The service resource for patch operations. + * + * @param {string} [parameters.placementConstraints] The placement constraints + * as a string. Placement constraints are boolean expressions on node + * properties and allow for restricting a service to particular nodes based on + * the service requirements. For example, to place a service on nodes where + * NodeType is blue specify the following: "NodeColor == blue)". + * + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. + * + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. + * + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. + * + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * + * @param {string} parameters.serviceKind Polymorphic Discriminator + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 ServiceResourceUpdate} 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 _beginUpdate(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2017-07-01-preview'; + // 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 (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (applicationName === null || applicationName === undefined || typeof applicationName.valueOf() !== 'string') { + throw new Error('applicationName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{applicationName}', encodeURIComponent(applicationName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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['ServiceResourceUpdate']().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 !== 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 === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ServiceResourceUpdate']().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); + }); +} + +/** + * @summary Deletes a Service Fabric service resource. + * + * Delete a Service Fabric service resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @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(resourceGroupName, clusterName, applicationName, serviceName, 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 apiVersion = '2017-07-01-preview'; + // 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 (clusterName === null || clusterName === undefined || typeof clusterName.valueOf() !== 'string') { + throw new Error('clusterName cannot be null or undefined and it must be of type string.'); + } + if (applicationName === null || applicationName === undefined || typeof applicationName.valueOf() !== 'string') { + throw new Error('applicationName cannot be null or undefined and it must be of type string.'); + } + if (serviceName === null || serviceName === undefined || typeof serviceName.valueOf() !== 'string') { + throw new Error('serviceName 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.ServiceFabric/clusters/{clusterName}/applications/{applicationName}/services/{serviceName}'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{clusterName}', encodeURIComponent(clusterName)); + requestUrl = requestUrl.replace('{applicationName}', encodeURIComponent(applicationName)); + requestUrl = requestUrl.replace('{serviceName}', encodeURIComponent(serviceName)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(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 Services. */ +class Services { + /** + * Create a Services. + * @param {ServiceFabricManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._get = _get; + this._create = _create; + this._update = _update; + this._deleteMethod = _deleteMethod; + this._list = _list; + this._beginCreate = _beginCreate; + this._beginUpdate = _beginUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + } + + /** + * @summary Gets a Service Fabric service resource. + * + * Get a Service Fabric service resource created or in the process of being + * created in the Service Fabric application resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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, clusterName, applicationName, serviceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, clusterName, applicationName, serviceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a Service Fabric service resource. + * + * Get a Service Fabric service resource created or in the process of being + * created in the Service Fabric application resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @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 {ServiceResource} - 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 ServiceResource} 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, clusterName, applicationName, serviceName, 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, clusterName, applicationName, serviceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, clusterName, applicationName, serviceName, options, optionalCallback); + } + } + + /** + * @summary Creates or updates a Service Fabric service resource. + * + * Create or update a Service Fabric service resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @param {object} parameters The service resource. + * + * @param {string} [parameters.placementConstraints] The placement constraints + * as a string. Placement constraints are boolean expressions on node + * properties and allow for restricting a service to particular nodes based on + * the service requirements. For example, to place a service on nodes where + * NodeType is blue specify the following: "NodeColor == blue)". + * + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. + * + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. + * + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. + * + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * + * @param {string} [parameters.serviceTypeName] The name of the service type + * + * @param {object} [parameters.partitionDescription] Describes how the service + * is partitioned. + * + * @param {string} parameters.partitionDescription.partitionScheme Polymorphic + * Discriminator + * + * @param {string} parameters.serviceKind Polymorphic Discriminator + * + * @param {string} [parameters.location] Azure resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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. + */ + createWithHttpOperationResponse(resourceGroupName, clusterName, applicationName, serviceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._create(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a Service Fabric service resource. + * + * Create or update a Service Fabric service resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @param {object} parameters The service resource. + * + * @param {string} [parameters.placementConstraints] The placement constraints + * as a string. Placement constraints are boolean expressions on node + * properties and allow for restricting a service to particular nodes based on + * the service requirements. For example, to place a service on nodes where + * NodeType is blue specify the following: "NodeColor == blue)". + * + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. + * + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. + * + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. + * + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * + * @param {string} [parameters.serviceTypeName] The name of the service type + * + * @param {object} [parameters.partitionDescription] Describes how the service + * is partitioned. + * + * @param {string} parameters.partitionDescription.partitionScheme Polymorphic + * Discriminator + * + * @param {string} parameters.serviceKind Polymorphic Discriminator + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 {ServiceResource} - 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 ServiceResource} 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. + */ + create(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._create(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._create(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, optionalCallback); + } + } + + /** + * @summary Updates a Service Fabric service resource. + * + * Update a Service Fabric service resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @param {object} parameters The service resource for patch operations. + * + * @param {string} [parameters.placementConstraints] The placement constraints + * as a string. Placement constraints are boolean expressions on node + * properties and allow for restricting a service to particular nodes based on + * the service requirements. For example, to place a service on nodes where + * NodeType is blue specify the following: "NodeColor == blue)". + * + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. + * + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. + * + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. + * + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * + * @param {string} parameters.serviceKind Polymorphic Discriminator + * + * @param {string} [parameters.location] Azure resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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(resourceGroupName, clusterName, applicationName, serviceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates a Service Fabric service resource. + * + * Update a Service Fabric service resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @param {object} parameters The service resource for patch operations. + * + * @param {string} [parameters.placementConstraints] The placement constraints + * as a string. Placement constraints are boolean expressions on node + * properties and allow for restricting a service to particular nodes based on + * the service requirements. For example, to place a service on nodes where + * NodeType is blue specify the following: "NodeColor == blue)". + * + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. + * + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. + * + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. + * + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * + * @param {string} parameters.serviceKind Polymorphic Discriminator + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 {ServiceResourceUpdate} - 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 ServiceResourceUpdate} 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(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, optionalCallback); + } + } + + /** + * @summary Deletes a Service Fabric service resource. + * + * Delete a Service Fabric service resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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, clusterName, applicationName, serviceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, clusterName, applicationName, serviceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a Service Fabric service resource. + * + * Delete a Service Fabric service resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @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, clusterName, applicationName, serviceName, 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, clusterName, applicationName, serviceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, clusterName, applicationName, serviceName, options, optionalCallback); + } + } + + /** + * @summary Gets the list of service resources created in the specified Service + * Fabric application resource. + * + * Gets all service resources created or in the process of being created in the + * Service Fabric application resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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(resourceGroupName, clusterName, applicationName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, clusterName, applicationName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the list of service resources created in the specified Service + * Fabric application resource. + * + * Gets all service resources created or in the process of being created in the + * Service Fabric application resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @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 {ServiceResourceList} - 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 ServiceResourceList} 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(resourceGroupName, clusterName, applicationName, 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(resourceGroupName, clusterName, applicationName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, clusterName, applicationName, options, optionalCallback); + } + } + + /** + * @summary Creates or updates a Service Fabric service resource. + * + * Create or update a Service Fabric service resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @param {object} parameters The service resource. + * + * @param {string} [parameters.placementConstraints] The placement constraints + * as a string. Placement constraints are boolean expressions on node + * properties and allow for restricting a service to particular nodes based on + * the service requirements. For example, to place a service on nodes where + * NodeType is blue specify the following: "NodeColor == blue)". + * + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. + * + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. + * + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. + * + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * + * @param {string} [parameters.serviceTypeName] The name of the service type + * + * @param {object} [parameters.partitionDescription] Describes how the service + * is partitioned. + * + * @param {string} parameters.partitionDescription.partitionScheme Polymorphic + * Discriminator + * + * @param {string} parameters.serviceKind Polymorphic Discriminator + * + * @param {string} [parameters.location] Azure resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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. + */ + beginCreateWithHttpOperationResponse(resourceGroupName, clusterName, applicationName, serviceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a Service Fabric service resource. + * + * Create or update a Service Fabric service resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @param {object} parameters The service resource. + * + * @param {string} [parameters.placementConstraints] The placement constraints + * as a string. Placement constraints are boolean expressions on node + * properties and allow for restricting a service to particular nodes based on + * the service requirements. For example, to place a service on nodes where + * NodeType is blue specify the following: "NodeColor == blue)". + * + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. + * + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. + * + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. + * + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * + * @param {string} [parameters.serviceTypeName] The name of the service type + * + * @param {object} [parameters.partitionDescription] Describes how the service + * is partitioned. + * + * @param {string} parameters.partitionDescription.partitionScheme Polymorphic + * Discriminator + * + * @param {string} parameters.serviceKind Polymorphic Discriminator + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 {ServiceResource} - 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 ServiceResource} 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. + */ + beginCreate(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreate(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreate(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, optionalCallback); + } + } + + /** + * @summary Updates a Service Fabric service resource. + * + * Update a Service Fabric service resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @param {object} parameters The service resource for patch operations. + * + * @param {string} [parameters.placementConstraints] The placement constraints + * as a string. Placement constraints are boolean expressions on node + * properties and allow for restricting a service to particular nodes based on + * the service requirements. For example, to place a service on nodes where + * NodeType is blue specify the following: "NodeColor == blue)". + * + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. + * + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. + * + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. + * + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * + * @param {string} parameters.serviceKind Polymorphic Discriminator + * + * @param {string} [parameters.location] Azure resource location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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. + */ + beginUpdateWithHttpOperationResponse(resourceGroupName, clusterName, applicationName, serviceName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates a Service Fabric service resource. + * + * Update a Service Fabric service resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @param {object} parameters The service resource for patch operations. + * + * @param {string} [parameters.placementConstraints] The placement constraints + * as a string. Placement constraints are boolean expressions on node + * properties and allow for restricting a service to particular nodes based on + * the service requirements. For example, to place a service on nodes where + * NodeType is blue specify the following: "NodeColor == blue)". + * + * @param {array} [parameters.correlationScheme] A list that describes the + * correlation of the service with other services. + * + * @param {array} [parameters.serviceLoadMetrics] The service load metrics is + * given as an array of ServiceLoadMetricDescription objects. + * + * @param {array} [parameters.servicePlacementPolicies] A list that describes + * the correlation of the service with other services. + * + * @param {string} [parameters.defaultMoveCost] Specifies the move cost for the + * service. Possible values include: 'Zero', 'Low', 'Medium', 'High' + * + * @param {string} parameters.serviceKind Polymorphic Discriminator + * + * @param {string} [parameters.location] Azure resource location. + * + * @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 {ServiceResourceUpdate} - 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 ServiceResourceUpdate} 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. + */ + beginUpdate(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginUpdate(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginUpdate(resourceGroupName, clusterName, applicationName, serviceName, parameters, options, optionalCallback); + } + } + + /** + * @summary Deletes a Service Fabric service resource. + * + * Delete a Service Fabric service resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [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(resourceGroupName, clusterName, applicationName, serviceName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, clusterName, applicationName, serviceName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a Service Fabric service resource. + * + * Delete a Service Fabric service resource with the specified name. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} clusterName The name of the cluster resource. + * + * @param {string} applicationName The name of the application resource. + * + * @param {string} serviceName The name of the service resource in the format + * of {applicationName}~{serviceName}. + * + * @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(resourceGroupName, clusterName, applicationName, serviceName, 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(resourceGroupName, clusterName, applicationName, serviceName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, clusterName, applicationName, serviceName, options, optionalCallback); + } + } + +} + +module.exports = Services; diff --git a/lib/services/serviceFabricManagement/lib/serviceFabricManagementClient.d.ts b/lib/services/serviceFabricManagement/lib/serviceFabricManagementClient.d.ts index e68ff6ed79..9d30f3de4f 100644 --- a/lib/services/serviceFabricManagement/lib/serviceFabricManagementClient.d.ts +++ b/lib/services/serviceFabricManagement/lib/serviceFabricManagementClient.d.ts @@ -10,9 +10,10 @@ import { ServiceClientCredentials } from 'ms-rest'; import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; import * as operations from "./operations"; -declare class ServiceFabricManagementClient extends AzureServiceClient { +export default class ServiceFabricManagementClient extends AzureServiceClient { /** * Initializes a new instance of the ServiceFabricManagementClient class. * @constructor @@ -20,7 +21,7 @@ declare class ServiceFabricManagementClient extends AzureServiceClient { * @class * @param {credentials} credentials - Credentials needed for the client to connect to Azure. * - * @param {string} subscriptionId - The customer subscription identifier + * @param {string} subscriptionId - The customer subscription identifier. * * @param {string} [baseUri] - The base URI of the service. * @@ -44,8 +45,6 @@ declare class ServiceFabricManagementClient extends AzureServiceClient { credentials: ServiceClientCredentials; - apiVersion: string; - subscriptionId: string; acceptLanguage: string; @@ -58,10 +57,10 @@ declare class ServiceFabricManagementClient extends AzureServiceClient { clusters: operations.Clusters; clusterVersions: operations.ClusterVersions; operations: operations.Operations; - applicationType: operations.ApplicationType; - version: operations.Version; - application: operations.Application; - service: operations.Service; + applicationTypes: operations.ApplicationTypes; + applicationTypeVersions: operations.ApplicationTypeVersions; + applications: operations.Applications; + services: operations.Services; } -export = ServiceFabricManagementClient; +export { ServiceFabricManagementClient, models as ServiceFabricManagementModels }; diff --git a/lib/services/serviceFabricManagement/lib/serviceFabricManagementClient.js b/lib/services/serviceFabricManagement/lib/serviceFabricManagementClient.js index 53760b09d2..d10b3b0556 100644 --- a/lib/services/serviceFabricManagement/lib/serviceFabricManagementClient.js +++ b/lib/services/serviceFabricManagement/lib/serviceFabricManagementClient.js @@ -27,7 +27,7 @@ class ServiceFabricManagementClient extends ServiceClient { /** * Create a ServiceFabricManagementClient. * @param {credentials} credentials - Credentials needed for the client to connect to Azure. - * @param {string} subscriptionId - The customer subscription identifier + * @param {string} subscriptionId - The customer subscription identifier. * @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 @@ -50,7 +50,6 @@ class ServiceFabricManagementClient extends ServiceClient { super(credentials, options); - this.apiVersion = '2017-07-01-preview'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -75,10 +74,10 @@ class ServiceFabricManagementClient extends ServiceClient { this.clusters = new operations.Clusters(this); this.clusterVersions = new operations.ClusterVersions(this); this.operations = new operations.Operations(this); - this.applicationType = new operations.ApplicationType(this); - this.version = new operations.Version(this); - this.application = new operations.Application(this); - this.service = new operations.Service(this); + this.applicationTypes = new operations.ApplicationTypes(this); + this.applicationTypeVersions = new operations.ApplicationTypeVersions(this); + this.applications = new operations.Applications(this); + this.services = new operations.Services(this); this.models = models; msRest.addSerializationMixin(this); } @@ -86,3 +85,6 @@ class ServiceFabricManagementClient extends ServiceClient { } module.exports = ServiceFabricManagementClient; +module.exports['default'] = ServiceFabricManagementClient; +module.exports.ServiceFabricManagementClient = ServiceFabricManagementClient; +module.exports.ServiceFabricManagementModels = models; diff --git a/lib/services/serviceFabricManagement/package.json b/lib/services/serviceFabricManagement/package.json index 947ea29a88..80431594c3 100644 --- a/lib/services/serviceFabricManagement/package.json +++ b/lib/services/serviceFabricManagement/package.json @@ -1,35 +1,25 @@ { "name": "azure-arm-servicefabric", "author": "Microsoft Corporation", - "contributors": [ - "Chen, Jeffrey" - ], + "description": "ServiceFabricManagementClient Library with typescript type definitions for node", "version": "2.0.0-preview", - "description": "Microsoft Azure ServiceFabric Management Client Library for node", - "tags": [ - "azure", - "sdk" - ], + "dependencies": { + "ms-rest": "^2.3.3", + "ms-rest-azure": "^2.5.5" + }, "keywords": [ "node", "azure" ], + "license": "MIT", "main": "./lib/serviceFabricManagementClient.js", "types": "./lib/serviceFabricManagementClient.d.ts", - "license": "MIT", - "dependencies": { - "ms-rest": "^2.2.2", - "ms-rest-azure": "^2.3.3" - }, - "homepage": "http://github.com/Azure/azure-sdk-for-node", + "homepage": "http://github.com/azure/azure-sdk-for-node", "repository": { "type": "git", - "url": "git@github.com:Azure/azure-sdk-for-node.git" + "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { "url": "http://github.com/Azure/azure-sdk-for-node/issues" - }, - "scripts": { - "test": "npm -s run-script jshint" } }