azure-cli
Version:
Microsoft Azure Cross Platform Command Line tool
105 lines (99 loc) • 3.93 kB
JavaScript
/*
* 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.
*/
;
const models = require('./index');
/**
* Describes an upgrade policy - automatic, manual, or rolling.
*
*/
class UpgradePolicy {
/**
* Create a UpgradePolicy.
* @member {string} [mode] Specifies the mode of an upgrade to virtual
* machines in the scale set.<br /><br /> Possible values are:<br /><br />
* **Manual** - You control the application of updates to virtual machines
* in the scale set. You do this by using the manualUpgrade action.<br /><br
* /> **Automatic** - All virtual machines in the scale set are
* automatically updated at the same time. Possible values include:
* 'Automatic', 'Manual', 'Rolling'
* @member {object} [rollingUpgradePolicy] The configuration parameters used
* while performing a rolling upgrade.
* @member {number} [rollingUpgradePolicy.maxBatchInstancePercent] The
* maximum percent of total virtual machine instances that will be upgraded
* simultaneously by the rolling upgrade in one batch. As this is a maximum,
* unhealthy instances in previous or future batches can cause the percentage
* of instances in a batch to decrease to ensure higher reliability. The
* default value for this parameter is 20%.
* @member {number} [rollingUpgradePolicy.maxUnhealthyInstancePercent] The
* maximum percentage of the total virtual machine instances in the scale set
* that can be simultaneously unhealthy, either as a result of being
* upgraded, or by being found in an unhealthy state by the virtual machine
* health checks before the rolling upgrade aborts. This constraint will be
* checked prior to starting any batch. The default value for this parameter
* is 20%.
* @member {number}
* [rollingUpgradePolicy.maxUnhealthyUpgradedInstancePercent] The maximum
* percentage of upgraded virtual machine instances that can be found to be
* in an unhealthy state. This check will happen after each batch is
* upgraded. If this percentage is ever exceeded, the rolling update aborts.
* The default value for this parameter is 20%.
* @member {string} [rollingUpgradePolicy.pauseTimeBetweenBatches] The wait
* time between completing the update for all virtual machines in one batch
* and starting the next batch. The time duration should be specified in ISO
* 8601 format. The default value is 0 seconds (PT0S).
* @member {boolean} [automaticOSUpgrade] Whether OS upgrades should
* automatically be applied to scale set instances in a rolling fashion when
* a newer version of the image becomes available.
*/
constructor() {
}
/**
* Defines the metadata of UpgradePolicy
*
* @returns {object} metadata of UpgradePolicy
*
*/
mapper() {
return {
required: false,
serializedName: 'UpgradePolicy',
type: {
name: 'Composite',
className: 'UpgradePolicy',
modelProperties: {
mode: {
required: false,
serializedName: 'mode',
type: {
name: 'Enum',
allowedValues: [ 'Automatic', 'Manual', 'Rolling' ]
}
},
rollingUpgradePolicy: {
required: false,
serializedName: 'rollingUpgradePolicy',
type: {
name: 'Composite',
className: 'RollingUpgradePolicy'
}
},
automaticOSUpgrade: {
required: false,
serializedName: 'automaticOSUpgrade',
type: {
name: 'Boolean'
}
}
}
}
};
}
}
module.exports = UpgradePolicy;